hl7nhapi

HL7 NHapi API OML_O21 PatientName object properties


I am using NHapi API http://nhapi.codeplex.com/ for HL7 in .net applcation. Request from audience to provide an example on how to set objects properties like PatientName and PatientAddress example in OML_021 object how we can set PatientAddress. I have tried through below line but it generate index out of range error actually HL7 XAD type array have 0 element .

o.PATIENT.PID.**GetPatientAddress()[0]**.StreetAddress.StreetName.Value =" Sample Address";

I do not see any function / property to set PatientAddress object which is actually of type actually HL7 XAD type array .

Thanks in advance


Solution

  • use

    PID.PID.GetPatientAddress(0).StreetAddress
    

    The get methods will expand the collection if the existing collection is too small for the required index.