`4F„2‡„MSH0\Ec:\tempHL7âd’ª³&â@#7ƒg ÿÿÿÿÿÿÿÿ#7ƒg|~FR#7ƒg^Sÿÿÿÿ#7ƒg&Tÿÿÿÿ ~HL7¦Ý»Wá¼Õ0PÚê$È¿Ý»Wá¼Õ0PÚê$È`#c™Header_#c™DateTimeofMessageMessageControlIDFields from the Header segmentG68’™x#G68’™x# `#c™Patient_#c™SetIDPID ExternalIDID InternalIDIDPNFamilyPNGivenPNMiddleInitialorNameDateTimeofBirthSexPAStreetPAOtherDesignationPACityPAStateProvinceZipCode HomeNumberBusinessNumberFields from PID segmentG68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x# G68’™x# G68’™x# G68’™x# G68’™x# G68’™x# G68’™x# `#c™ AttendingDoc_#c™SetIDPVAttendingDoctorIDNumberAttendingDoctorFamilyNameAttendingDoctorGivenName"AttendingDoctorMiddleInitialorNameFinancialClassFinancialclassPV1 segment fieldsG68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#`#c™Gurantor_#c™SetIDGTGuarantorNumberIDGuarantorNameFamilyNameGuarantorNameGivenName GuarantorNameMiddleInitialorNameGuarantorSpouseNameFamilyNameGuarantorSpouseNameGivenName&GuarantorSpouseNameMiddleInitialorNameGuarantorAddressStreetAddress GuarantorAddressOtherDesignationGuarantorAddressCityGuarantorAddressStateorProvinceGuarantorAddressZiporpostalcodeGuarantorPhNumHomeNumberGuarantorPhNumBusinessNumberGuarantorDateTimeofBirth GuarantorSexGuarantorRelationshipGurantorG68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x#G68’™x# `#c™Event_#c™ EventTypeCodeRecordedDateTimeEventReasonCodeFields from EVN segmentG68’™x#G68’™x#G68’™x#Y4F„V6&‡ AdmitPatientÿÿÿÿE53TE53T9'MSH52’Field Separatorc”STCb3ValueString52’Encoding Characters652’Sending Applicationc”EICb3Entity Identifier6Cb3 Namespace IDc”ISCb3Value#Coded value for user-defined tablesCb3 Universal ID6Cb3Universal ID Typec”IDCb3IDCoded values for HL7 tablesEntity Identifier52’Sending Facility:52’Receiving Application:52’Receiving Facility:52’Date/Time of Messagec”TSCb3Value‰Tr Time Stamp !0(YYYY[MM[DD[HH[MM[SS[.SSSS]]]]]][+/-ZZZZ] Time stamp52’Security652’ Message Typec”CM_MSHCb3EventACb3TypeAMSH Event-Type Composite52’Message Control ID652’ Processing IDc”PTCb3Processing TypeACb3Processing ModeAProcessing Type52’ Version IDA52’Sequence Numberc”NMCb3ValueNumeric52’Continuation Pointer652’Accept Acknowledgement TypeA52’ Application Acknowledgement TypeA52’ Country CodeA52’ Character SetA52’Principal Language of Messagec”CECb3 Identifier6Cb3Text6Cb3Name of coding system6Cb3Alternate Identifier6Cb3Alternate Text6Cb3Name of Coding System6 Coded ElementMessage HeaderE53T9'EVN52’Event Type CodeA52’Recorded Date/TimeG52’Date/Time Planned EventG52’Event Reason Code=52’ Operator IDc”XCNCb3 ID Number6Cb3 Family Name6Cb3 Given Name6Cb3Middle Initial or Name6Cb3Suffix6Cb3Prefix6Cb3Degree6Cb3 Source Table=Cb3Assigning authorityc”HDCb3 Namespace=Cb3 Universal ID6Cb3 Universal IDAHierarchic DesignatorCb3Name type codeACb3Identifier check digit6Cb30Code identifying the check digit scheme employed6Cb3Identifier type code=Cb3Assigning Facilityv%Extended composite ID number and name52’Event OccurredG Event TypeE53T9'PID52’ Set ID - PIDc”SICb3Value Sequence ID52’Patient ID (External ID)c”CXCb3ID6Cb3 Check Digit6Cb30Code Identifying the check digit scheme employedACb3Assigning AuthorityvCb3Identifier Type Code=Cb3Assigning Facilityv&Extended composite ID with check digit52’Patient ID (Internal ID)†52’Alternate Patient ID - PID†52’ Patient Namec”XPNCb3 Family Name6Cb3 Given Name6Cb3Middle Initial or Name6Cb3Suffix6Cb3Prefix6Cb3Degree6Cb3Name Type CodeAExtended person name52’Mother's Maiden Name52’Date/Time of BirthG52’Sex=52’ Patient Alias52’Race=52’Patient Addressc”XAD Cb3Street Address6Cb3Other Designation6Cb3City6Cb3State or Province6Cb3Zip or postal code6Cb3CountryACb3 Address typeACb3Other geographic designation6Cb3Country/parish code=Cb3 Census Tract=Extended Address52’ County Code=52’Phone Number - Homec”XTN Cb3Number6Cb3Telecommunications use codeACb3!Telecommunications equipment typeACb3 Email Address6Cb3 Country CodeVCb3Area/City CodeVCb3 Phone NumberVCb3 ExtensionVCb3Any Text6"Extended telecommunications number52’Phone Number - Business«52’Primary Language^52’Marital Status=52’Religion=52’Patient Account Number†52’SSN Number - Patient652’Driver's Licence Number-Patientc”DLNCb3License Number6Cb3Issuing province, country=Cb3Expiration Datec”DTCb3Value‰TrDate (YYYY[MM[DD]]DateDriver's License Number52’Mother's Identifier†52’ Ethnic Group=52’ Birth Place652’Multiple Birth IndicatorA52’ Birth OrderV52’ Citizenship=52’Veterans Military Status^52’ Nationalty^52’Patient Death Date and TimeG52’Patient Death IndicatorAPatient IdentificationE53T9'PV1452’ Set ID - PV1ƒ52’ Patient Class=52’Assigned Patient Locationc”PL Cb3 Point of Care=Cb3Room=Cb3Bed=Cb3FacilityvCb3Location Status=Cb3Person Location Type=Cb3Building=Cb3Floor=Cb3Location Description6Person location52’Admission Type=52’Preadmit Number†52’Prior Patient LocationÒ52’Attending Doctorl52’Referring Doctorl52’Consulting Doctorl52’Hospital Service=52’Temporary LocationÒ52’Preadmit Test Indicator=52’Readmission Indicator=52’ Admit Source=52’Ambulatory Status=52’ VIP Indicator=52’Admitting Doctorl52’ Patient Type=52’ Visit Number†52’Financial Classc”FCCb3Financial classACb3Effective dateGFinancial class52’Charge Price Indicator=52’ Courtesy Code=52’ Credit Rating=52’ Contract Code=52’Contract Effective DateÀ52’Contract AmountV52’Contract PeriodV52’ Interest Code=52’Transfer to Bad Debt Code=52’Transfer to Bad Debt DateÀ52’Bad Debt Agency Code=52’Bad Debt Transfer AmountV52’Bad Debt Recovery AmountV52’Delete Account Indicator=52’Delete Account DateÀ52’Discharge Disposition=52’Discharged to Locationc”CMCb3Field1Cb3Field2Cb3Field3Cb3Field4Cb3Field5Cb3Field6Composite - discouraged52’ Diet Type=52’Servicing Facility=52’ Bed Status=52’Account Status=52’Pending LocationÒ52’Prior Temporary LocationÒ52’Admit Date/TimeG52’Discharge Date/TimeG52’Current Patient BalanceV52’ Total ChargesV52’Total AdjustmentsV52’Total PaymentsV52’Alternate Visit ID†52’Visit Indicator=52’Other Healthcare Providerl Patient VisitE53T9'GT1752’ Set ID - GT1ƒ52’Guarantor Number†52’Guarantor Name52’Guarantor Spouse Name52’Guarantor Addressž52’Guarantor Ph Num- Home«52’Guarantor Ph Num-Business«52’Guarantor Date/Time of BirthG52’ Guarantor Sex=52’Guarantor Type=52’Guarantor Relationship=52’ Guarantor SSN652’Guarantor Date - BeginÀ52’Guarantor Date - EndÀ52’Guarantor PriorityV52’Guarantor Employer Name52’Guarantor Employer Addressž52’Guarantor Employer Phone Number«52’Guarantor Employee ID Number†52’Guarantor Employment Status=52’Guarantor Organization Namec”XONCb3Organization Name6Cb3Organization name type code=Cb3 ID NumberVCb3 Check DigitVCb3 Code Identifying the Check DigitACb3Assigning AuthorityvCb3Identifier Type Code=Cb3Assigned Facilityv%Extended composite name and ID number52’Guarantor Billing Hold FlagA52’Guarantor Credit Rating Code^52’Guarantor Death Date And TimeG52’Guarantor Death FlagA52’ Guarantor Charge Adjustment Code^52’!Guarantor Household Annual Incomec”CPCb3Pricec”MOCb3QuantityVCb3 DenominationAMoneyCb3 Price TypeACb3 From ValueVCb3To ValueVCb3 Range Units^Cb3 Range TypeAComposite Price52’Guarantor Household SizeV52’Guarantor Employer ID Number†52’Guarantor Marital Status Code=52’Guarantor Hire Effective DateÀ52’Guarantor Employment Stop DateÀ52’Living Dependency=52’Ambulatory Status=52’ Citizenship=52’Primary Language^52’Living Arrangement=52’Publicity Indicator^52’Protection IndicatorA52’Student Indicator=52’Religion=52’Mother’s Maiden Name52’ Nationality^52’ Ethnic Group=52’Contact Person's Name52’!Contact Person’s Telephone Number«52’Contact Reason^52’Contact Relationship=52’ Job Title652’Job Code/Classc”JCCCb3Job code=Cb3 Job class=Job code/class52’&Guarantor Employer's Organization Name.52’Handicap=52’ Job Status=52’Guarantor Financial Classí52’Guarantor Race= GuarantorE53T9'IN1152’ Set ID - IN1ƒ52’Insurance Plan ID^52’Insurance Company ID†52’Insurance Company Name.52’Insurance Company Addressž52’Insurance Co. Contact Person52’Insurance Co Phone Number«52’ Group Number652’ Group Name.52’Insured's Group Emp ID†52’Insured's Group Emp Name.52’Plan Effective DateÀ52’Plan Expiration DateÀ52’Authorization Information52’ Plan Type=52’Name of Insured52’!Insured's Relationship to Patient=52’Insured's Date of BirthG52’Insured's Addressž52’Assignment of Benefits=52’Coordination of Benefits=52’Coord of Ben. Priority652’Notice of Admission FlagA52’Notice of Admission DateÀ52’Rpt of Eligibility FlagA52’Rpt of Eligibility DateÀ52’Release Information Code=52’Pre-Admit Cert (PAC)652’Verification Date/TimeG52’Verification Byl52’Type of Agreement Code=52’Billing Status=52’Lifetime Reserve DaysV52’Delay Before L. R. DayV52’Company Plan Code=52’ Policy Number652’Policy Deductible=52’Policy Limit - Amount=52’Policy Limit - DaysV52’Room Rate - Semi-Private=52’Room Rate - Private=52’Insured's Employment Status^52’ Insured's Sex=52’Insured's Employer Addressž52’Verification Status652’Prior Insurance Plan ID=52’ Coverage Type=52’Handicap=52’Insured's ID Number† InsuranceE53T9'IN2H52’Insured's Employee ID†52’ Insured's Social Security Number652’Insured's Employer Namel52’Employer Information Data=52’Mail Claim Party=52’Medicare Health Ins Card Number652’Medicaid Case Name52’Medicaid Case Number652’Champus Sponsor Name52’Champus ID Number652’Dependent of Champus Recipient^52’Champus Organization652’Champus Station652’Champus Service=52’Champus Rank/Grade=52’Champus Status=52’Champus Retire DateÀ52’Champus Non-Avail Cert on FileA52’ Baby CoverageA52’Combine Baby BillA52’Blood Deductible652’Special Coverage Approval Name52’Special Coverage Approval Title652’Non-Covered Insurance Code=52’Payor ID†52’Payor Subscriber ID†52’Eligibility Source=52’Room Coverage Type/Amount52’Policy Type/Amount52’Daily Deductible52’Living Dependency=52’Ambulatory Status=52’ Citizenship=52’Primary Language^52’Living Arrangement=52’Publicity Indicator^52’Protection IndicatorA52’Student Indicator=52’Religion=52’Mother’s Maiden Name52’ Nationality^52’ Ethnic Group=52’Marital Status=52’Insured's Employment Start DateÀ52’Insured's Employment Stop DateÀ52’ Job Title652’Job Code/Class^52’ Job Status=52’Employer Contact Person Name52’$Employer Contact Person Phone Number«52’Employer Contact Reason=52’Insured’s Contact Person’s Name52’)Insured’s Contact Person Telephone Number«52’Insured’s Contact Person Reason=52’&Relationship To The Patient Start DateÀ52’%Relationship To The Patient Stop DateÀ52’Insurance Co. Contact Reason=52’!Insurance Co Contact Phone Number«52’ Policy Scope=52’ Policy Source=52’Patient Member Number†52’#Guarantor’s Relationship To Insured=52’!Insured’s Telephone Number - Home«52’#Insured’s Employer Telephone Number«52’Military Handicapped Program^52’ Suspend FlagA52’Copay Limit FlagA52’Stoploss Limit FlagA52’ Insured Organization Name And ID.52’)Insured Employer Organization Name And ID.52’Race=52’$HCFA Patient Relationship to Insured^ Insurance Additional InformationMessageV6&‡ÿÿÿÿ3V6&‡ÿÿÿÿe-V6&‡ÿÿÿÿ€V6&‡ÿÿÿÿÍV6&‡ÿÿÿÿ2ADT™x#A01™x# AdmitPatientAdmit a PatientAG=l6vƒ†ž«VÀ.^=?^í:LQ¼Òfgš4ÎI EDEBDFEBDFE7HGJJFJHJ;HJLIHJLIJMSHMSHdimport re # We have to write this code to figure out if we have a business or a home phone number # The home phone is presented in the format # (XXX)-XXX-XXXXCHome # and the business phone is presented in the format # (XXX)-XXX-XXXXCWork # This code breaks that string apart and decides if the phone number is a business or a home one. # First set these variables to be empty HomePhoneNumber = "" BusinessPhoneNumber = "" log("PID 13 = " + value) # we split the value into two parts - before and after the C NumArray = re.split( "C" , value , 2) # now we check that we got two parts if len(NumArray) > 1: PhoneNumber = NumArray[0] PhoneType = NumArray[1] elif len(NumArray) == 1: PhoneNumber = NumArray[0] PhoneType = NumArray[1] else: log("No phone number present") # now if a phone number was present then - i.e. len(NumArray) > 0 then if PhoneType == "Home": HomePhoneNumber = PhoneNumber log("PID -13 had the home phone number") else: BusinessPhoneNumber = PhoneNumber log("PID -13 had the business phone number") ¬import re log("PID 14 = " + value) # we split the value into two parts - before and after the C NumArray = re.split( "C" , value , 2) # now we check that we got two parts if len(NumArray) > 1: PhoneNumber = NumArray[0] PhoneType = NumArray[1] elif len(NumArray) == 1: PhoneNumber = NumArray[0] PhoneType = "Home" else: log("No phone number present") # now if a phone number was present then - i.e. len(NumArray) > 0 then if PhoneType == "Home": HomePhoneNumber = PhoneNumber log("PID -14 had the home phone number") else: BusinessPhoneNumber = PhoneNumber log("PID -14 had the business phone number") ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿdefaultÿÿÿÿvalue = HomePhoneNumber value = BusinessPhoneNumberMapsetMapsetMapsetMapsetMapset¼ßÖ[F] ÿÿÿÿ2ÿÿÿÿ3ÿÿÿÿeÿÿÿÿ€ÿÿÿÿÍÿÿÿÿADT™x#MSHA01™x#MSH2UTF8ÿÿÿÿASCII