Wiki source code of Data update with batch file
Last modified by Mr on 2025/08/13 11:46
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | The ClinLab software allows data updates in the database using batch import. Rules for records update are almost same as for import and it must meet the following conditions: | ||
| 2 | |||
| 3 | * File extension is **txt** or **csv**. | ||
| 4 | * File encoding is **UTF-8 without BOM**. | ||
| 5 | * Columns are separated by **commas**. | ||
| 6 | * Text **does not** need to be **enclosed** in quotation marks unless it contains a comma. | ||
| 7 | * Decimal numbers are separated by a **dot.** | ||
| 8 | * Dates are in the format **DD/MM/YYYY**. | ||
| 9 | * Checkbox values are "**on**" (checked) or "**off**" (unchecked). | ||
| 10 | * The **first row** contains a **header** with the identification of imported parameters. | ||
| 11 | * The first column contains the patient **identification** (idPatient), followed by the form definition (form) where the parameter we want to update is located, and then the parameter definition (param) separated by an underscore. | ||
| 12 | * For **categorical parameters**, the imported text value must **exactly match** the displayed text on the form. | ||
| 13 | |||
| 14 | **Identification of patient parameters:** | ||
| 15 | |||
| 16 | You can use the following items for identifying patient parameters: | ||
| 17 | |||
| 18 | |=((( | ||
| 19 | Identification | ||
| 20 | )))|=((( | ||
| 21 | Description | ||
| 22 | )))|=((( | ||
| 23 | Format | ||
| 24 | ))) | ||
| 25 | |((( | ||
| 26 | **~ idPatient** | ||
| 27 | )))|((( | ||
| 28 | ID patient (**mandatory**) | ||
| 29 | )))|((( | ||
| 30 | number | ||
| 31 | ))) | ||
| 32 | |((( | ||
| 33 | //firstName// | ||
| 34 | )))|((( | ||
| 35 | name | ||
| 36 | )))|((( | ||
| 37 | text | ||
| 38 | ))) | ||
| 39 | |((( | ||
| 40 | //lastName// | ||
| 41 | )))|((( | ||
| 42 | surname | ||
| 43 | )))|((( | ||
| 44 | text | ||
| 45 | ))) | ||
| 46 | |((( | ||
| 47 | //sex// | ||
| 48 | )))|((( | ||
| 49 | sex | ||
| 50 | )))|((( | ||
| 51 | M - male | ||
| 52 | |||
| 53 | F - female | ||
| 54 | ))) | ||
| 55 | |((( | ||
| 56 | //address// | ||
| 57 | )))|((( | ||
| 58 | adress | ||
| 59 | )))|((( | ||
| 60 | text | ||
| 61 | ))) | ||
| 62 | |((( | ||
| 63 | //personalID// | ||
| 64 | )))|((( | ||
| 65 | personal identification number | ||
| 66 | )))|((( | ||
| 67 | 700101/1111 | ||
| 68 | ))) | ||
| 69 | |((( | ||
| 70 | //email// | ||
| 71 | )))|((( | ||
| 72 | |||
| 73 | )))|((( | ||
| 74 | [[text@email.cz>>mailto:text@email.cz]] | ||
| 75 | ))) | ||
| 76 | |((( | ||
| 77 | //telephone// | ||
| 78 | )))|((( | ||
| 79 | telephone number | ||
| 80 | )))|((( | ||
| 81 | (+420)731111111 | ||
| 82 | ))) | ||
| 83 | |((( | ||
| 84 | //healthInsurance// | ||
| 85 | )))|((( | ||
| 86 | heath insurance | ||
| 87 | )))|((( | ||
| 88 | name of health insurance | ||
| 89 | ))) | ||
| 90 | |((( | ||
| 91 | //birthDate// | ||
| 92 | )))|((( | ||
| 93 | date of birth | ||
| 94 | )))|((( | ||
| 95 | 01/01/1970 | ||
| 96 | ))) | ||
| 97 | |||
| 98 | **Identification of other form parameters:** | ||
| 99 | |||
| 100 | Identification of other parameters on the form can be found in the data export to xlsx format. The number of imported parameters is not limited. | ||
| 101 | |||
| 102 | The format for identifying an imported parameter is form{idForm}_param{idParam}. | ||
| 103 | |||
| 104 | Each form in the study has its own ID, and to retrieve it, you need to contact the administrator. | ||
| 105 | |||
| 106 | Each parameter in the form has its own ID. These IDs can be obtained from the data export to Excel. | ||
| 107 | |||
| 108 | [[image:https://confluence.imtm.cz/download/attachments/38895655/image2020-5-8_15-34-3.png?version=1&modificationDate=1592302789000&api=v2]] | ||
| 109 | |||
| 110 | **Example of update batch files** | ||
| 111 | |||
| 112 | Numbers with decimal comma are separated by quotes, and checkbox selections are set using the values on/off. | ||
| 113 | |||
| 114 | [[image:https://confluence.imtm.cz/download/attachments/74055746/image2022-5-17_13-5-6.png?version=1&modificationDate=1652792706000&api=v2]] | ||
| 115 | |||
| 116 | [[image:image2020-6-16_10-54-16.png||height="41"]] | ||
| 117 | |||
| 118 | **Description of the last example:** | ||
| 119 | |||
| 120 | * Updating data for patient with ID 28620 | ||
| 121 | * Updating data on forms 775 and 774 | ||
| 122 | * Updating parameters 5119, 5120, 5122, 5123, and 6796 | ||
| 123 | |||
| 124 | **Update batch file example of record not specified by idPatient** | ||
| 125 | |||
| 126 | Update of record not identified with idPatient, but by user unique paramter specified in column "key". Please beware if more matches for key parameter are find, only value of first finding is updated. | ||
| 127 | |||
| 128 | [[image:1755067395862-464.png||height="75" width="657"]] | ||
| 129 | |||
| 130 | **Update batch file example of repeated parameter** | ||
| 131 | |||
| 132 | Update of record with idPatient 100000 within specific repeating. Name of repeating parameter is defined in column "key" and specific value needs to be defined in separate column. In this case "form19_param20264". | ||
| 133 | |||
| 134 | [[image:1755067117984-199.png||height="70" width="800"]] | ||
| 135 | |||
| 136 |