Question Oleksandr Kyrylov · Apr 1, 2022

Find All Property Names in hl7 Message

Hello Community!

Is in objectscript way to get all properties names from HL7 Message?

For example I have HL7 message:

MSH|^~\&|MIHIN PATIENT GEN|1.2.3.4.5.9.99.999.9999.1004||2.16.840.1.113883.3.1481|20200103000000+0000||ADT^A01^ADT_A01|1092|P|2.6|1091|||||||||Windward General Hospital
EVN||20200110000000+0000|||||1.2.3.4.5.9.99.999.9999.1004
PID|1|3170|44c8a6bba5c743538e476a813256959b^^^^CKS~000003170^^^^SS||Santana^Pearl||19900609|F||2054-5^Black or African American^HL70005|364 NE Oak Circle^^Trenton^MI^48183||||||||000003170|||N^Not Hispanic or Latino^HL70189|||||||20200110000000+0000|N
PD1|||Windward General Hospital^^^^^^^^^1.2.3.4.5.9.99.999.9999.1004|9999992221^Johnston^Karl^^^^^^^^^^NPI^^^^^^^^MD
PV1|1|I|^^67^1.2.3.4.5.9.99.999.9999.1004||||9999992221^Johnston^Karl^^^^^^^^^^NPI||||||||||||17a5e3aa59a34ad5af017998278a5eb5||||||||||||||||||&HOME^20200110000000+0000|||||||20200103000000DG1|1||Z34.90^Normal pregnancy^I10||20200103000000+0000|F|^Become_Pregnant
IN1|1|1772^STATE HEALTH PLAN|1027|MEDICAID||||||||||||Santana^Pearl^Gladys|||364 NE Oak Circle^^Trenton^MI^48183

 

and i want to extract all properties names (setidpid, patientid, datetimeofbirth, patientaccountnumber .....)

Thanks!

Product version: IRIS 2020.1

Comments

Shamus Clifford · Apr 1, 2022

Have you tried GetContentArray() from EnsLib.HL7.Message? Then you could do something similar to Testing Virtual Property Paths in the Terminal. For example,

ClassMethod PrintPropertyPaths(){
 set string="MSH|^~\&|MIHIN PATIENT GEN|1.2.3.4.5.9.99.999.9999.1004||2.16.840.1.113883.3.1481|20200103000000+0000||ADT^A01^ADT_A01|1092|P|2.6|1091|||||||||Windward General Hospital"_$C(13,10)_
            "EVN||20200110000000+0000|||||1.2.3.4.5.9.99.999.9999.1004"_
            "PID|1|3170|44c8a6bba5c743538e476a813256959b^^^^CKS~000003170^^^^SS||Santana^Pearl||19900609|F||2054-5^Black or African American^HL70005|364 NE Oak Circle^^Trenton^MI^48183||||||||000003170|||N^Not Hispanic or Latino^HL70189|||||||20200110000000+0000|N"_$C(13,10)_
            "PD1|||Windward General Hospital^^^^^^^^^1.2.3.4.5.9.99.999.9999.1004|9999992221^Johnston^Karl^^^^^^^^^^NPI^^^^^^^^MD"_$C(13,10)_
            "PV1|1|I|^^67^1.2.3.4.5.9.99.999.9999.1004||||9999992221^Johnston^Karl^^^^^^^^^^NPI||||||||||||17a5e3aa59a34ad5af017998278a5eb5||||||||||||||||||&HOME^20200110000000+0000|||||||20200103000000DG1|1||Z34.90^Normal pregnancy^I10||20200103000000+0000|F|^Become_Pregnant"_$C(13,10)_
            "IN1|1|1772^STATE HEALTH PLAN|1027|MEDICAID||||||||||||Santana^Pearl^Gladys|||364 NE Oak Circle^^Trenton^MI^48183"_$C(13,10)
 set target=##class(EnsLib.HL7.Message).ImportFromString(string,.status)
 if 'status {do $system.Status.DisplayError(status) quit}
 set target.DocType="2.6:ADT_A01"
 
 do target.GetContentArray(.propertyPaths,, target.DocType)
 for i=1:1:propertyPaths {
   for j=1:1:propertyPaths(i) {
     i, ".", j, propertyPaths(i,j, "name"), !
   }
 }}
0
Oleksandr Kyrylov  Apr 5, 2022 to Shamus Clifford

I saw that method, but I did not undarstand how it works. Thank you! It works for me

0