`4F„2‡„MSH0\Ec:\tempHL7#7ƒg ÿÿÿÿÿÿÿÿ#7ƒg|~FR#7ƒg^Sÿÿÿÿ#7ƒg&Tÿÿÿÿ ÿHL7ˆ„öø×{‘<ÚX~zO4ሄöø×{‘<ÚX~zO4á`#c™ObservationTable_#c™ObservationIdentifierObservationValueG68’™x#G68’™x#Y4F„V6&‡ LabResultÿÿÿÿE53TE53T9'MSH52’Field Separatorc”STCb3Value String Data52’Encoding Characters52’Sending Applicationc”HDCb3 Namespace IDc”ISCb3Value String DataCb3 Universal IDCb3Universal ID Typec”IDCb3Value String DataHierarchic Designator52’Sending Facility 52’Receiving Application 52’Receiving Facility 52’Date/time Of Messagec”TSCb3Timec”DTMCb3Value‰TrDateTime !0 DTM DateTime Date/TimeCb3Degree Of Precision Time Stamp52’Security52’ Message Typec”MSGCb3 Message CodeCb3 Trigger EventCb3Message Structure Message Type52’Message Control ID52’ Processing IDc”PTCb3 Processing IDCb3Processing ModeProcessing Type52’ Version IDc”VIDCb3 Version IDCb3Internationalization Codec”CECb3 IdentifierCb3TextCb3Name Of Coding SystemCb3Alternate IdentifierCb3Alternate TextCb3Name Of Alternate Coding System Coded ElementCb3International Version ID-Version Identifier52’Sequence Numberc”NMCb3ValueNumeric52’Continuation Pointer52’Accept Acknowledgment Type52’Application Acknowledgment Type52’ Country Code52’ Character Setÿÿÿÿ52’Principal Language Of Message-52’'Alternate Character Set Handling Scheme52’Message Profile Identifierÿÿÿÿc”EICb3Entity IdentifierCb3 Namespace IDCb3 Universal IDCb3Universal ID TypeEntity IdentifierMessage HeaderE53T9'OBX52’ Set ID - Obxc”SICb3Value Sequence ID52’ Value Type52’Observation Identifier-52’Observation Sub-id52’Observation Valueÿÿÿÿ52’Units-52’References Range52’Abnormal Flagsÿÿÿÿ52’ Probability652’Nature Of Abnormal Testÿÿÿÿ52’Observation Result Status52’!Effective Date Of Reference Range52’User Defined Access Checks52’Date/time Of The Observation52’ Producer's ID-52’Responsible Observerÿÿÿÿc”XCNCb3 ID NumberCb3 Family Namec”FNCb3SurnameCb3Own Surname PrefixCb3 Own SurnameCb3"Surname Prefix From Partner/spouseCb3Surname From Partner/spouse Family NameCb3 Given NameCb32Second And Further Given Names Or Initials ThereofCb3Suffix (e.g., Jr Or III)Cb3Prefix (e.g., Dr)Cb3Degree (e.g., Md)Cb3 Source TableCb3Assigning Authority Cb3Name Type CodeCb3Identifier Check DigitCb3Check Digit SchemeCb3Identifier Type CodeCb3Assigning Facility Cb3Name Representation CodeCb3 Name Context-Cb3Name Validity Rangec”DRCb3Range Start Date/timeCb3Range End Date/timeDate/Time RangeCb3Name Assembly OrderCb3Effective DateCb3Expiration DateCb3Professional SuffixCb3Assigning Jurisdictionc”CWE Cb3 IdentifierCb3TextCb3Name Of Coding SystemCb3Alternate IdentifierCb3Alternate TextCb3Name Of Alternate Coding SystemCb3Coding System Version IDCb3"Alternate Coding System Version IDCb3 Original TextCoded With ExceptionsCb3Assigning Agency Or Departmenty1Extended Composite ID Number And Name For Persons52’Observation Methodÿÿÿÿ-52’Equipment Instance Identifierÿÿÿÿ@52’Date/time Of The AnalysisObservation/ResultMessageV6&‡ÿÿÿÿEORU™x#R01™x# LabResultUnsolicited Observation Message#  @&-*6HYy\qc”XON Cb3Organization NameCb3Organization Name Type CodeCb3 ID Number6Cb3 Check Digit6Cb3Check Digit SchemeCb3Assigning Authority Cb3Identifier Type CodeCb3Assigning Facility Cb3Name Representation CodeCb3Organization IdentifierCExtended Composite Name And Identification Number For Organizationsc”PL Cb3 Point Of CareCb3RoomCb3BedCb3Facility Cb3Location StatusCb3Person Location TypeCb3BuildingCb3FloorCb3Location DescriptionCb3!Comprehensive Location Identifier@Cb3 Assigning Authority For Location Person Locationc”XADCb3Street Addressc”SADCb3Street Or Mailing AddressCb3 Street NameCb3Dwelling NumberStreet AddressCb3Other DesignationCb3CityCb3State Or ProvinceCb3Zip Or Postal CodeCb3CountryCb3 Address TypeCb3Other Geographic DesignationCb3County/parish CodeCb3 Census TractCb3Address Representation CodeCb3Address Validity RangeqCb3Effective DateCb3Expiration DateExtended Address¡c”CNE Cb3 IdentifierCb3TextCb3Name Of Coding SystemCb3Alternate IdentifierCb3Alternate TextCb3Name Of Alternate Coding SystemCb3Coding System Version IDCb3"Alternate Coding System Version IDCb3 Original TextCoded With No Exceptionsc”TQ Cb3Quantityc”CQCb3Quantity6Cb3Units-Composite Quantity With UnitsCb3Intervalc”RICb3Repeat PatternCb3Explicit Time IntervalRepeat IntervalCb3DurationCb3Start Date/timeCb3 End Date/timeCb3PriorityCb3 ConditionCb3Textc”TXCb3Value Text DataCb3 ConjunctionCb3Order Sequencingc”OSD Cb3Sequence/results FlagCb3&Placer Order Number: Entity IdentifierCb3!Placer Order Number: Namespace IDCb3&Filler Order Number: Entity IdentifierCb3!Filler Order Number: Namespace IDCb3Sequence Condition ValueCb3Maximum Number Of Repeats6Cb3!Placer Order Number: Universal IDCb3&Placer Order Number: Universal ID TypeCb3!Filler Order Number: Universal IDCb3&Filler Order Number: Universal ID TypeOrder Sequence DefinitionCb3Occurrence Duration-Cb3Total Occurrences6Timing Quantity˾Ïc”EIPCb3Placer Assigned Identifier@Cb3Filler Assigned Identifier@Entity Identifier Pairc”XTN Cb3Telephone NumberCb3Telecommunication Use CodeCb3 Telecommunication Equipment TypeCb3 Email AddressCb3 Country Code6Cb3Area/city Code6Cb3 Local Number6Cb3 Extension6Cb3Any TextCb3Extension PrefixCb3Speed Dial CodeCb3Unformatted Telephone Number!Extended Telecommunication Numberc”DLNCb3License NumberCb3 Issuing State, Province, CountryCb3Expiration Datec”DTCb3Value‰TrDateDT DateDateDriver's License Numberñc”XPNCb3 Family Name\Cb3 Given NameCb32Second And Further Given Names Or Initials ThereofCb3Suffix (e.g., Jr Or III)Cb3Prefix (e.g., Dr)Cb3Degree (e.g., Md)Cb3Name Type CodeCb3Name Representation CodeCb3 Name Context-Cb3Name Validity RangeqCb3Name Assembly OrderCb3Effective DateCb3Expiration DateCb3Professional SuffixExtended Person Namec”CX Cb3 ID NumberCb3 Check DigitCb3Check Digit SchemeCb3Assigning Authority Cb3Identifier Type CodeCb3Assigning Facility Cb3Effective DateñCb3Expiration DateñCb3Assigning JurisdictionyCb3Assigning Agency Or Departmenty&Extended Composite ID With Check Digitc”DLDCb3Discharge LocationCb3Effective DateDischarge Location And Datec”FCCb3Financial Class CodeCb3Effective DateFinancial ClassF9'ORC52’ Order Control52’Placer Order Number@52’Filler Order Number@52’Placer Group Number@52’ Order Status52’ Response Flag52’Quantity/timingÿÿÿÿ¼52’ParentÝ52’Date/time Of Transaction52’ Entered ByÿÿÿÿY52’ Verified ByÿÿÿÿY52’Ordering ProviderÿÿÿÿY52’Enterer's Location“52’Call Back Phone Numberÿÿÿÿà52’Order Effective Date/time52’Order Control Code Reason-52’Entering Organization-52’Entering Device-52’ Action ByÿÿÿÿY52’ Advanced Beneficiary Notice Code-52’Ordering Facility Nameÿÿÿÿˆ52’Ordering Facility AddressÿÿÿÿŸ52’Ordering Facility Phone Numberÿÿÿÿà52’Ordering Provider AddressÿÿÿÿŸ52’Order Status Modifiery52’+Advanced Beneficiary Notice Override Reasony52’(Filler's Expected Availability Date/time52’Confidentiality Codey52’ Order Typey52’Enterer Authorization Mode² Common Order9'PID'52’ Set ID - PidH52’ Patient ID52’Patient Identifier Listÿÿÿÿ52’Alternate Patient ID - Pidÿÿÿÿ52’ Patient Nameÿÿÿÿô52’Mother's Maiden Nameÿÿÿÿô52’Date/time Of Birth52’Administrative Sex52’ Patient Aliasÿÿÿÿô52’Raceÿÿÿÿ-52’Patient AddressÿÿÿÿŸ52’ County Code52’Phone Number - Homeÿÿÿÿà52’Phone Number - Businessÿÿÿÿà52’Primary Language-52’Marital Status-52’Religion-52’Patient Account Number52’Ssn Number - Patient52’!Driver's License Number - Patientí52’Mother's Identifierÿÿÿÿ52’ Ethnic Groupÿÿÿÿ-52’ Birth Place52’Multiple Birth Indicator52’ Birth Order652’ Citizenshipÿÿÿÿ-52’Veterans Military Status-52’ Nationality-52’Patient Death Date And Time52’Patient Death Indicator52’Identity Unknown Indicator52’Identity Reliability Codeÿÿÿÿ52’Last Update Date/time52’Last Update Facility 52’ Species Code-52’ Breed Code-52’Strain52’Production Class Code-52’Tribal CitizenshipÿÿÿÿyPatient Identification9'PV1452’ Set ID - Pv1H52’ Patient Class52’Assigned Patient Location“52’Admission Type52’Preadmit Number52’Prior Patient Location“52’Attending DoctorÿÿÿÿY52’Referring DoctorÿÿÿÿY52’Consulting DoctorÿÿÿÿY52’Hospital Service52’Temporary Location“52’Preadmit Test Indicator52’Re-admission Indicator52’ Admit Source52’Ambulatory Statusÿÿÿÿ52’ Vip Indicator52’Admitting DoctorÿÿÿÿY52’ Patient Type52’ Visit Number52’Financial Classÿÿÿÿ52’Charge Price Indicator52’ Courtesy Code52’ Credit Rating52’ Contract Codeÿÿÿÿ52’Contract Effective Dateÿÿÿÿñ52’Contract Amountÿÿÿÿ652’Contract Periodÿÿÿÿ652’ Interest Code52’Transfer To Bad Debt Code52’Transfer To Bad Debt Dateñ52’Bad Debt Agency Code52’Bad Debt Transfer Amount652’Bad Debt Recovery Amount652’Delete Account Indicator52’Delete Account Dateñ52’Discharge Disposition52’Discharged To Location52’ Diet Type-52’Servicing Facility52’ Bed Status52’Account Status52’Pending Location“52’Prior Temporary Location“52’Admit Date/time52’Discharge Date/timeÿÿÿÿ52’Current Patient Balance652’ Total Charges652’Total Adjustments652’Total Payments652’Alternate Visit ID52’Visit Indicator52’Other Healthcare ProviderÿÿÿÿY Patient Visitó MACHINEIDCODEMSHMSHbtry: OBXSetID OBXSetID += 1 except NameError: OBXSetID = 1 value = str(OBXSetID) !value = 'TX' ValueType = value ObservationIdentifier = value dObservationValue = value value = ' ' # this will create an OBX segment with empty string in OBX-5 .value = 'F' ObservationResultStatus = value þÿÿÿdefaultÿÿÿÿMapsetÿÿÿÿÿÿÿÿEORU™x#MSHR01™x#MSHASCIIÿÿÿÿASCII.ASCIITABLE - Short TagsOBXSetID = 0 '4‡OBX5sList = [] # create empty Python list # build a new OBX segment, as it shows in customer sample message def another_OBX(nextObservationLine): global OBXSetID # Hint: we have to update a variable defined outside of function OBXSetID += 1 return 'OBX|' + str(OBXSetID) \ + '|' \ + ValueType \ + '|' \ + ObservationIdentifier \ + 2 * '|' \ + nextObservationLine \ + 6 * '|' \ + ObservationResultStatus + '\r' # split customer Report content into lines and append lines to Python list def split_report(ObservationValue): global OBX5sList while ObservationValue.count('\\R\\') > 0: # Hint: each tilde is escaped by Chameleon try: ObservationValue.index('\\R\\') position = ObservationValue.index('\\R\\') OBX5sList.append( ObservationValue[:position] ) ObservationValue = ObservationValue[(position + 3):] # Hint: \R\ takes exactly 3 characters except ValueError: pass OBX5sList.append(ObservationValue) return # process the Report content if len(ObservationValue) > 0 and ObservationValue != ' ': # split Report content into list of lines split_report(ObservationValue) # iterate on entire list of Report lines, and concatenate new OBX segments to message for nextObservationLine in OBX5sList: value = value + another_OBX(nextObservationLine)