`4F2MSH0\Ec:\tempHL7#7g #7g|~FR#7g^S#7g&T ~HL7i5NLJjRw5d.G`e3vY4FV6&DefaultE53TE53T9'MSH52Field SeparatorcSTCb3Value String Data52Encoding Characters52Sending ApplicationcHDCb3 Namespace IDcISCb3Value String DataCb3 Universal IDCb3Universal ID TypecIDCb3Value String DataHierarchic Designator52Sending Facility 52Receiving Application 52Receiving Facility 52Date/time Of MessagecTSCb3TimecDTMCb3ValueTrDateTime !0 DTM DateTime Date/timeCb3Degree Of Precision Time Stamp52Security52 Message TypecMSGCb3 Message CodeCb3 Trigger EventCb3Message Structure Message Type52Message Control ID52 Processing IDcPTCb3 Processing IDCb3Processing ModeProcessing Type52 Version IDcVIDCb3 Version IDCb3Internationalization CodecCECb3 IdentifierCb3TextCb3Name Of Coding SystemCb3Alternate IdentifierCb3Alternate TextCb3Name Of Alternate Coding System Coded ElementCb3International Version ID*Version Identifier52Sequence NumbercNMCb3ValueNumeric52Continuation Pointer52Accept Acknowledgment Type52Application Acknowledgment Type52 Country Code52 Character Set52Principal Language Of Message*52'Alternate Character Set Handling Scheme52Message Profile IdentifiercEICb3Entity IdentifierCb3 Namespace ID Cb3 Universal IDCb3Universal ID TypeEntity IdentifierMessage HeaderMessageDefault Person Update%  #'*3=cSICb3Value Sequence IDcCX Cb3 ID NumberCb3 Check DigitCb3Check Digit SchemeCb3Assigning Authority Cb3Identifier Type CodeCb3Assigning Facility Cb3Effective DatecDTCb3ValueDateCb3Expiration DateLCb3Assigning JurisdictioncCWE 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 DepartmentP&Extended Composite ID With Check DigitLPcXON Cb3Organization NameCb3Organization Name Type Code Cb3 ID Number3Cb3 Check Digit3Cb3Check Digit SchemeCb3Assigning Authority Cb3Identifier Type CodeCb3Assigning Facility Cb3Name Representation CodeCb3Organization IdentifierCExtended Composite Name And Identification Number For OrganizationscXADCb3Street AddresscSADCb3Street Or Mailing AddressCb3 Street NameCb3Dwelling NumberStreet AddressCb3Other DesignationCb3CityCb3State Or ProvinceCb3Zip Or Postal CodeCb3CountryCb3 Address TypeCb3Other Geographic DesignationCb3County/parish Code Cb3 Census Tract Cb3Address Representation CodeCb3Address Validity RangecDRCb3Range Start Date/timeCb3Range End Date/timeDate/time RangeCb3Effective DateCb3Expiration DateExtended AddresshwcXPNCb3 Family NamecFNCb3SurnameCb3Own 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) Cb3Name Type CodeCb3Name Representation CodeCb3 Name Context*Cb3Name Validity RangewCb3Name Assembly OrderCb3Effective DateCb3Expiration DateCb3Professional SuffixExtended Person Name~cXTN Cb3Telephone NumberCb3Telecommunication Use CodeCb3 Telecommunication Equipment TypeCb3 Email AddressCb3 Country Code3Cb3Area/city Code3Cb3 Local Number3Cb3 Extension3Cb3Any TextCb3Extension PrefixCb3Speed Dial CodeCb3Unformatted Telephone Number!Extended Telecommunication NumbercAUICb3Authorization NumberCb3DateLCb3SourceAuthorization InformationcXCNCb3 ID NumberCb3 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) Cb3 Source Table Cb3Assigning Authority Cb3Name Type CodeCb3Identifier Check DigitCb3Check Digit SchemeCb3Identifier Type CodeCb3Assigning Facility Cb3Name Representation CodeCb3 Name Context*Cb3Name Validity RangewCb3Name Assembly OrderCb3Effective DateCb3Expiration DateCb3Professional SuffixCb3Assigning JurisdictionPCb3Assigning Agency Or DepartmentP1Extended Composite ID Number And Name For PersonscCPCb3PricecMOCb3Quantity3Cb3 DenominationMoneyCb3 Price TypeCb3 From Value3Cb3To Value3Cb3 Range Units*Cb3 Range TypeComposite PricecDLNCb3License NumberCb3 Issuing State, Province, Country Cb3Expiration DateLDriver_s License NumbercJCCCb3Job Code Cb3 Job Class Cb3Job Description TextcTXCb3Value Text DataJob Code/classcPTACb3 Policy Type Cb3 Amount Class Cb3Money Or Percentage Quantity3Cb3Money Or PercentagecMOPCb3Money Or Percentage IndicatorCb3Money Or Percentage Quantity3Cb3Currency DenominationMoney Or PercentagePolicy Type And AmountcDDICb3 Delay Days3Cb3Monetary AmountCb3Number Of Days3Daily Deductible InformationcRMCCb3 Room Type Cb3 Amount Type Cb3Coverage Amount3Cb3Money Or Percentage Room CoveragecDLDCb3Discharge Location Cb3Effective DateDischarge Location And DatecPL Cb3 Point Of Care Cb3Room Cb3Bed Cb3Facility Cb3Location Status Cb3Person Location Type Cb3Building Cb3Floor Cb3Location DescriptionCb3!Comprehensive Location Identifier=Cb3 Assigning Authority For Location Person LocationcFCCb3Financial Class Code Cb3Effective DateFinancial Class9'IN1552 Set ID - In1B52Insurance Plan ID*52Insurance Company IDD52Insurance Company Name[52Insurance Company Addressf52Insurance Co Contact Person|52Insurance Co Phone Number52 Group Number52 Group Name[52Insured's Group Emp IDD52Insured's Group Emp Name[52Plan Effective DateL52Plan Expiration DateL52Authorization Information52 Plan Type 52Name Of Insured|52!Insured's Relationship To Patient*52Insured's Date Of Birth52Insured's Addressf52Assignment Of Benefits 52Coordination Of Benefits 52Coord Of Ben. Priority52Notice Of Admission Flag52Notice Of Admission DateL52Report Of Eligibility Flag52Report Of Eligibility DateL52Release Information Code 52Pre-admit Cert (pac)52Verification Date/time52Verification By52Type Of Agreement Code 52Billing Status 52Lifetime Reserve Days352Delay Before L.r. Day352Company Plan Code 52 Policy Number52Policy Deductible52Policy Limit - Amount52Policy Limit - Days352Room Rate - Semi-private52Room Rate - Private52Insured's Employment Status*52Insured's Administrative Sex 52Insured's Employer's Addressf52Verification Status52Prior Insurance Plan ID 52 Coverage Type 52Handicap 52Insured's ID NumberD52Signature Code 52Signature Code DateL52Insured_s Birth Place52 Vip Indicator Insurance9'PID'52 Set ID - PidB52 Patient IDD52Patient Identifier ListD52Alternate Patient ID - PidD52 Patient Name|52Mother's Maiden Name|52Date/time Of Birth52Administrative Sex 52 Patient Alias|52Race*52Patient Addressf52 County Code 52Phone Number - Home52Phone Number - Business52Primary Language*52Marital Status*52Religion*52Patient Account NumberD52Ssn Number - Patient52!Driver's License Number - Patient52Mother's IdentifierD52 Ethnic Group*52 Birth Place52Multiple Birth Indicator52 Birth Order352 Citizenship*52Veterans Military Status*52 Nationality*52Patient Death Date And Time52Patient Death Indicator52Identity Unknown Indicator52Identity Reliability Code 52Last Update Date/time52Last Update Facility 52 Species Code*52 Breed Code*52Strain52Production Class Code*52Tribal CitizenshipPPatient Identification9'NK1'52 Set ID - Nk1B52Name|52 Relationship*52Addressf52 Phone Number52Business Phone Number52 Contact Role*52 Start DateL52End DateL52*Next Of Kin / Associated Parties Job Title52/Next Of Kin / Associated Parties Job Code/class520Next Of Kin / Associated Parties Employee NumberD52Organization Name - Nk1[52Marital Status*52Administrative Sex 52Date/time Of Birth52Living Dependency 52Ambulatory Status 52 Citizenship*52Primary Language*52Living Arrangement 52Publicity Code*52Protection Indicator52Student Indicator 52Religion*52Mother's Maiden Name|52 Nationality*52 Ethnic Group*52Contact Reason*52Contact Person's Name|52!Contact Person's Telephone Number52Contact Person's Addressf52*Next Of Kin/associated Party's IdentifiersD52 Job Status 52Race*52Handicap 52%Contact Person Social Security Number52Next Of Kin Birth Place52 Vip Indicator Next Of Kin / Associated Parties9'EVN52Event Type Code52Recorded Date/time52Date/time Planned Event52Event Reason Code 52 Operator ID52Event Occurred52Event Facility Event Type9'IN2H52Insured's Employee IDD52 Insured's Social Security Number52 Insured's Employer's Name And ID52Employer Information Data 52Mail Claim Party 52Medicare Health Ins Card Number52Medicaid Case Name|52Medicaid Case Number52Military Sponsor Name|52Military ID Number52Dependent Of Military Recipient*52Military Organization52Military Station52Military Service 52Military Rank/grade 52Military Status 52Military Retire DateL52Military Non-avail Cert On File52 Baby Coverage52Combine Baby Bill52Blood Deductible52Special Coverage Approval Name|52Special Coverage Approval Title52Non-covered Insurance Code 52Payor IDD52Payor Subscriber IDD52Eligibility Source 52Room Coverage Type/amount52Policy Type/amount52Daily Deductible52Living Dependency 52Ambulatory Status 52 Citizenship*52Primary Language*52Living Arrangement 52Publicity Code*52Protection Indicator52Student Indicator 52Religion*52Mother's Maiden Name|52 Nationality*52 Ethnic Group*52Marital Status*52Insured's Employment Start DateL52Employment Stop DateL52 Job Title52Job Code/class52 Job Status 52Employer Contact Person Name|52$Employer Contact Person Phone Number52Employer Contact Reason 52Insured's Contact Person's Name|52%Insured's Contact Person Phone Number52Insured's Contact Person Reason 52&Relationship To The Patient Start DateL52%Relationship To The Patient Stop DateL52Insurance Co. Contact Reason 52!Insurance Co Contact Phone Number52 Policy Scope 52 Policy Source 52Patient Member NumberD52#Guarantor's Relationship To Insured*52Insured's Phone Number - Home52Insured's Employer Phone Number52Military Handicapped Program*52 Suspend Flag52Copay Limit Flag52Stoploss Limit Flag52 Insured Organization Name And ID[52)Insured Employer Organization Name And ID[52Race*52%Cms Patient_s Relationship To Insured* Insurance Additional Information9'PV1452 Set ID - Pv1B52 Patient Class 52Assigned Patient Location52Admission Type 52Preadmit NumberD52Prior Patient Location52Attending Doctor52Referring Doctor52Consulting Doctor52Hospital Service 52Temporary Location52Preadmit Test Indicator 52Re-admission Indicator 52 Admit Source 52Ambulatory Status 52 Vip Indicator 52Admitting Doctor52 Patient Type 52 Visit NumberD52Financial Class52Charge Price Indicator 52 Courtesy Code 52 Credit Rating 52 Contract Code 52Contract Effective DateL52Contract Amount352Contract Period352 Interest Code 52Transfer To Bad Debt Code 52Transfer To Bad Debt DateL52Bad Debt Agency Code 52Bad Debt Transfer Amount352Bad Debt Recovery Amount352Delete Account Indicator 52Delete Account DateL52Discharge Disposition 52Discharged To Location52 Diet Type*52Servicing Facility 52 Bed Status 52Account Status 52Pending Location52Prior Temporary Location52Admit Date/time52Discharge Date/time52Current Patient Balance352 Total Charges352Total Adjustments352Total Payments352Alternate Visit IDD52Visit Indicator 52Other Healthcare Provider Patient Visit MACHINEIDCODEL# we invoke a global function called scrub_name value = scrub_name(field) L# we invoke a global function called scrub_name value = scrub_name(field) # we invoke a global function called scrub_name # there is a small issue with the first field "value" # which means we have to get it as the return value of # function value = scrub_name(field) defaultdef scrub_name(Field): for FieldIndex in range(0, Field.count_of_subfield()): if not Field.subfield(FieldIndex).is_null(): Field.subfield(FieldIndex).value = 'fff' return Field.subfield(0).value .current_segment = environment.input_segment_iterator() current_segment.apply_transform() output = current_segment.output() while current_segment.move_one(): # append each segment which is not a Z segment if current_segment.segment_id()[0] <> 'Z': current_segment.apply_transform() # apply segment equations output = output + current_segment.output() value = output ASCIISTANDARD VER 25''H4