Conversion
Synopsis
Conversion tool to connect to an Interbase database which writes all images to disk and writes the necessary JSON structures for use in the PWA program.
Images database
- Create a program to write images to file and create a JSON structure that matches the database info to the filenames on disk.
- User Input:
- Database name
- Output Directory
- Each file is written as
ID.ext - JSON Object with elements:
- 'p' : File path (path component of field PAD)
- 'n' : File name (path component if field PAD)
- 'id': ID (field number)
Kabisa database
- Create a program that queries the KABISA database and writes the necessary JSON structures (an array of object) which represent the data in the database table.
For each object, a file is written that contains a statement similar to the following:
var SomeJSVar = [ {"p":"name"}, {"p":"name2"} ] ;
- User input:
- Database name
- Output directory
- Checkbox listbox with selection of objects to convert. (+all/nothing selection)
Table LINGUESYM - Object Symptom
- FileName: symptoms.js
- variable: symptoms
- Type: array of Symptom objects
Map the data in LINGUESYM and table Excludes to object Symptom:
- id from field nrsid.
- name object with fields:
- en from field SYMPE
- it from field SYMPI
- nl from field SYMPN
- de from field SYMPD
- fr from field SYMPF
- pt from field SYMPP
- es from field SYMPS
- id from field SYMPINDO
- ttype from field TTYPE
- StartUp from field STARTUP
- bitmap from field BITMAP (BITAMP<>0)
- prob object with fields:
- af: from field P_Africa
- as: from field P_Asia
- am: from field P_America
- gp: from field P_GP
- tr: from field P_TRAVEL
- alarm from field ALARM (Alarm<>0)
- expand from field EXPAND (EXPAND<>0)
-
sortNr object with fields
- en from field SYMPE_SORTNR
- it from field SYMPI_SORTNR
- nl from field SYMPN_SORTNR
- de from field SYMPD_SORTNR
- fr from field SYMPF_SORTNR
- pt from field SYMPP_SORTNR
- es from field SYMPS_SORTNR
- id from field SYMPINDO_SORTNR
-
comune object with fields
- af: from field COMUNE_Africa
- as: from field COMUNE_Asia
- am: from field COMUNE_America
- gp: from field COMUNE_GP
- tr: from field COMUNE_TRAVEL
- excludes array of IDS from table EXCLUDES
- if id matches EXCLUDES.NRSID, then add EXCLUDES.NRSEXCLUDE to array
- if id matches EXCLUDES.NRSEXCLUDE, then add EXCLUDES.NRS** to array
Table LINGUEDIAG - Object Diagnosis
- FileName: diagnioses.js
- variable: diagnioses
- Type: array of Diagnose objects
Map the data in LINGUEDIAG to object Diagnose:
- id from field nrz.
- name object with fields:
- en from field ZIEKE
- it from field ZIEKI
- nl from field ZIEKN
- de from field ZIEKD
- fr from field ZIEKF
- pt from field ZIEKP
- id from field
- cutOff from field CUTOFF
- startUp from field STARTUP
- startUpGp from field STARTUP_GP
- *PC object with fields:
- af: from field P_Africa
- as: from field P_Asia
- am: from field P_America
- gp: from field P_GP
- tr: from field P_TRAVEL
- counter from field teller
- sortNr object with fields:
- en from field ZIEKE_SORTNR
- it from field ZIEKI_SORTNR
- nl from field ZIEKN_SORTNR
- de from field ZIEKD_SORTNR
- fr from field ZIEKF_SORTNR
- pt from field ZIEKP_SORTNR
- id from field ZIEKINDO_SORTNM
Table ASSOCDATA2 - Object Association
- FileName: association.js
- variable: associations
- Type: array of Association objects
Map the data in table ASSOCDATA2 to object Association using the following mapping:
- diagId from field nrz
- symId from field nrs
- sens from field SENS
- conf Confirmation power of assocation. Object fields:
- af: from field Africa_PC
- as: from field Asia_PC
- am: from field America_PC
- gp: from field GP_PC
- tr : from field TRAVEL_PC
- excl Exclusion power of assocation. Object fields
- af: from field Africa_PE
- as: from field Asia_PE
- am: from field America_PE
- gp: from field GP_PE
- tr : from field TRAVEL_PE
Object ImagePathInfo
- FileName: imagepathinfo.js
- variable: imagepathinfo
- Type: array of objects ImagePathInfo
The data in this object comes from various tables, distinguished by field cat:
- stool encapsulates data from RandomStoolNP.
- rx encapsulates data from RXDifferent.
- neg encapsulates data from NegativPath
- subj encapsulates data from MenWomChild
- imm encapsulates data from PathImm
- clin encapsulates data from ClinicalImage
RandomstoolNP
Property cat is stool
| Field | Property |
|---|---|
| NUMEROR | symID |
| PATH | path |
| TTYPE | N/A |
| CAT | N/A |
RXDifferent
Property cat is rx
| Field | Property |
|---|---|
| NRS | symId |
| PATH | path |
| SUBJECT | subj |
NegativPath
Property cat is neg
| Field | Property |
|---|---|
| NRS | symId |
| PATH | path |
PathImm
Property cat is imm
| Field | Property |
|---|---|
| NRS | symID |
| PATH | path |
ClinicalImage
Property cat is clin
Only convert records that have PresentIM <> 0
| Field | Property |
|---|---|
| NRS | symId |
| NRZ | diagId |
| AGE | subj |
| CONTINENT | cont |
| PATH | Path |
| PRESENTIM | N/A |
MenWomChild
Property cat is subj
| Field | Property |
|---|---|
| NRS | symId |
| SUBJECT | subj |
| PATH | path |
Table IMPLIES - Object Implies
- FileName: implies.js
- variable: implies
- Type: array of Implies objects
Map the data in table IMPLIES to object Implies
- symId from field nrs
- impliesSymId from field nrsimplies
Table MAYCAUSE - Object Implies
- FileName: maycause.js
- variable: maycause
- Type: array of MayCause objects
Map the data in table IMPLIES to object Implies
- symId : from field nrs
- mayCauseSymId from field nrsmaycause
Object Synonym
- FileName: synonyms.js
- variable: synonyms
-
Type: object with Synonym objects per language:
- en from table SYNOEN
- it from table SYNOIT
- nl from table SYNODU
- de from table SYNOGE
- fr from table SYNOFR
- pt from table SYNOPO
- id from table SYNOINDO
-
Each synonym is mapped as follows:
- names array of objects:
- id from field nrs
- name from field SYMPE
- sort from field SORTNR
Strings
All the displayed strings in the legacy Kabisa are in the database, table sstring. This table is filled with the strings from linguestring
The strings must be converted to resource strings. 2 files are generated: * Units.Strings this is a file with a series of Resourcestring definitions. * strings.js this is a Javascript strings definition object.
Generating Units.Strings:
- From table linguestring generate a pascal unit with the following:
here the following fields of LingueString are used:
ResourceString RS_N = 'English text'; var TranslatedStrings : TJSObject; external name 'translatedStrings'; - N is the content of field Number .
- The english text is the content of field EN
Generating file strings.js
-
From table linguestring generate a javascript file with the following:
The translatedstrings object has members for the following languages:var translatedStrings = { "en" { "Units.Strings" : { "RS_1" : "The text number 1 in english", "RS_2" : "The text number 2 in english", } }, "fr" { "Units.Strings" : { "RS_1" : "The text number 1 in french", "RS_1" : "The text number 2 in french" } }, } -
en: English (field EN)
- nl: Dutch (field DU)
- fr: French (field FR)
- it: Italian (field IT)
- de: German (field GE)
- es: Spanish (field SP)
- pt: Portugese (field pt)
-
id: Indonesian (field INDO)
-
On program startup, the selected language is read from Paramaters.language and used to translate the resource strings:
Procedure TranslateKabisa; var ResStrings : TJSObject; begin ResStrings:=TJSOBject(TranslatedStrings[Parameters.Language]); if ResStrings<>Nil then rstranslate.Translate(ResStrings); end;
The same is done when the user selects the language in Setup;