CSV Upload: Support for multi select obs, Add more for concept and section.

There is no support to migrate multi-select observations, Add more for a concept and Add more for section in Bahmni encounter CSV upload.

Proposed Approach:

  • Use of Single Column and values are separated by configurable character(s).

  • Enclose the entire value in special characters like [], {} etc to identify the column as multi select concept/ Add more concept in a section / concept in Add more for a section.

Eg:

Multi-select for concept

     Assume that delimiter for Multi-select for concept = $

     Column Value => [CodedValue1$CodedValue2$CodedValue3]

Add more for a concept in a section

    Assume that delimiter for Add more for concept = %

    Column Value => [Value1%Value2%Value3]

Add more for a section

   Assume that delimiter for Add more for section = ^

Sample 1:

Weight => [Weight1^Weight2^Weight3]

Height => [Height1^Height2^Height3]

Sample 2:

Weight => [Weight1^^Weight3]

Height => [Height1^Height2^]

Weight => [60^70^80^]

Height => [160^170^^180]

Add more for a concept inside Add more section

Heart Rate = [[100%101%102]^[103%104]^105]

Cardiovascular disease = [TRUE^FALSE^Unknown]

CC: @angshuonline @vmalini @pratibhasagar @vinisha @shivarachakonda

Related talk thread: CSV Upload: No support to migrate multi-select obs in encounter csv upload

Comments from @angshuonline in PAT call - Overloading the Value column as above seems error prone, especially for human editing. For programmatic creation of CSV this might be ok, and in that case, probably better to introduce different columns to hold such values.

Modified Approach Using one more extra column for remaining values for multi select, Add more values.

Multi-select for concept :

Assume that delimiter for Multi-select for concept = $

Column Heading : Repeat.1.Obs.form2$SampleForm$Heart$Cardiovascular
Column Value  : TRUE

Column Heading : Repeat.1.Obs.form2$SampleForm$Heart$Cardiovascular.MultiSelect
Column Value : FALSE$Unknown

Add more for a concept in a section

Assume that delimiter for Add more for concept = %

Assume that concept Heart Rate is having Add more option.

Column Heading : Repeat.1.Obs.form2$SampleForm$Heart$HeartRate

Column Value  : HeightValue1

Column Heading : Repeat.1.Obs.form2$SampleForm$Heart$HeartRate.AddMoreConcept

Column Value : HeightValue2%HeightValue3

Add more for a section

Assume that delimiter for Add more for section = ^

Column Heading : Repeat.1.Obs.form2$SampleForm$BMI$Height

Column Value  : HeightValue1

Column Heading : Repeat.1.Obs.form2$SampleForm$BMI.AddMoreSection$Height

Column Value : HeightValue2^HeightValue3
		
Column Heading : Repeat.1.Obs.form2$SampleForm$BMI$Weight

Column Value  : WeightValue1

Column Heading : Repeat.1.Obs.form2$SampleForm$BMI.AddMoreSection$Weight

Column Value : WeightValue2^WeightValue3

Multi Select for a concept inside Add more section

Column Heading : Repeat.1.Obs.form2$SampleForm$Heart$Cardiovascular

Column Value  : 

Column Heading : Repeat.1.Obs.form2$SampleForm$Heart.AddmoreSection$Cardiovascular.MultiSelect

Column Value : TRUE$FALSE$Unknown^FALSE$Unknown^TRUE$FALSE
1 Like

Comments in today’s PAT call notes

Modified Approach

  • Suffixing column headings with attributes (AddmoreSection=true, AddmoreConcept=true, MultiSelect=true etc)
  • Add more concept or multi select concept values are separated by delimiter eg : $ (Configurable property)
  • Use of Separate row for each Add more section. We will be using Patient Identifier, Visit Start Date, Visit Type and Encounter Date to join such multiple CSV rows

Eg:

Sample Form:

Filled Form:

CSV File

Assumptions:

  • Concept can not have Add more and multi select attributes at the same time.

Limitations:

  • Support one level of nesting for Add more sections.
  • Separate columns for each inner Add more Section concept. Column heading specifies attribute such as InnerSectionValueIndex=1

Nested Sections Sample Form

Filled Form:

CSV File :

1 Like

Approach for multi select obs

  • Read Observation properties from form definition (.json)
  • Provide multiple values separated by delimiter. Global property bahmni.admin.csv.upload.obs.multiSelect.splitter used to define delimiter. Default Value is |
2 Likes