From 3bcdbd5fdf8c8bf76133ebebb0951cccf9f9019f Mon Sep 17 00:00:00 2001 From: Vinay Kapoor Date: Thu, 25 Jul 2024 21:27:01 +0530 Subject: [PATCH] Added missing message types like MDM_T03, MDM_T04 etc from v2.5 to v2.8 --- hl7apy/v2_5/groups.py | 102 +++++++++++++++++++++ hl7apy/v2_5/messages.py | 98 ++++++++++++++++++++ hl7apy/v2_5_1/groups.py | 102 +++++++++++++++++++++ hl7apy/v2_5_1/messages.py | 98 ++++++++++++++++++++ hl7apy/v2_6/groups.py | 102 +++++++++++++++++++++ hl7apy/v2_6/messages.py | 113 +++++++++++++++++++++++ hl7apy/v2_7/groups.py | 112 +++++++++++++++++++++++ hl7apy/v2_7/messages.py | 124 ++++++++++++++++++++++++++ hl7apy/v2_8/__init__.py | 2 +- hl7apy/v2_8/base_datatypes.py | 134 ++++++++++++++++++++++++++++ hl7apy/v2_8/groups.py | 163 ++++++++++++++++++++++++++++++++++ hl7apy/v2_8/messages.py | 134 ++++++++++++++++++++++++++++ 12 files changed, 1283 insertions(+), 1 deletion(-) create mode 100644 hl7apy/v2_8/base_datatypes.py diff --git a/hl7apy/v2_5/groups.py b/hl7apy/v2_5/groups.py index be9347e..dda615e 100644 --- a/hl7apy/v2_5/groups.py +++ b/hl7apy/v2_5/groups.py @@ -3166,6 +3166,108 @@ 'VXX_V02_PATIENT': ('sequence', (['PID', SEGMENTS['PID'], (1, 1), 'SEG'], ['NK1', SEGMENTS['NK1'], (0, -1), 'SEG'],)), + 'MDM_T03_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T03_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T03_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T04_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T04_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T04_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T04_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T05_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T05_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T05_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T06_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T06_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T06_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T06_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T07_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T07_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T07_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T08_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T08_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T08_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T08_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T09_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T09_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T09_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T10_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T10_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T10_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T10_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T11_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T11_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T11_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R31_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'ORU_R31_TIMING_QTY': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R31_VISIT': ('sequence', + (['PV1', SEGMENTS['PV1'], (1, 1), 'SEG'], + ['PV2', SEGMENTS['PV2'], (0, 1), 'SEG'],)), + 'ORU_R32_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'ORU_R32_TIMING_QTY': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R32_VISIT': ('sequence', + (['PV1', SEGMENTS['PV1'], (1, 1), 'SEG'], + ['PV2', SEGMENTS['PV2'], (0, 1), 'SEG'],)), } for k, v in iteritems(GROUPS): for item in v[1]: diff --git a/hl7apy/v2_5/messages.py b/hl7apy/v2_5/messages.py index 3f1a45a..5f0854e 100644 --- a/hl7apy/v2_5/messages.py +++ b/hl7apy/v2_5/messages.py @@ -1709,4 +1709,102 @@ ('QRD', SEGMENTS['QRD'], (1, 1), 'SEG'), ('QRF', SEGMENTS['QRF'], (0, 1), 'SEG'), ('VXX_V02_PATIENT', GROUPS['VXX_V02_PATIENT'], (1, -1), 'GRP'),)), + 'MDM_T03': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T03_COMMON_ORDER', GROUPS['MDM_T03_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T04': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T04_COMMON_ORDER', GROUPS['MDM_T04_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (0, 1), 'SEG'), + ('MDM_T04_OBXNTE', GROUPS['MDM_T04_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T05': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T05_COMMON_ORDER', GROUPS['MDM_T05_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T06': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T06_COMMON_ORDER', GROUPS['MDM_T06_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T06_OBXNTE', GROUPS['MDM_T06_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T07': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T07_COMMON_ORDER', GROUPS['MDM_T07_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T08': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T08_COMMON_ORDER', GROUPS['MDM_T08_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T08_OBXNTE', GROUPS['MDM_T08_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T09': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T09_COMMON_ORDER', GROUPS['MDM_T09_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T10': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T10_COMMON_ORDER', GROUPS['MDM_T10_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T10_OBXNTE', GROUPS['MDM_T10_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T11': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T11_COMMON_ORDER', GROUPS['MDM_T11_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'ORU_R31': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PD1', SEGMENTS['PD1'], (0, 1), 'SEG'), + ('ORU_R31_VISIT', GROUPS['ORU_R31_VISIT'], (0, 1), 'GRP'), + ('ORC', SEGMENTS['ORC'], (1, 1), 'SEG'), + ('OBR', SEGMENTS['OBR'], (1, 1), 'SEG'), + ('NTE', SEGMENTS['NTE'], (0, -1), 'SEG'), + ('ORU_R31_TIMING_QTY', GROUPS['ORU_R31_TIMING_QTY'], (0, -1), 'GRP'), + ('ORU_R31_OBSERVATION', GROUPS['ORU_R31_OBSERVATION'], (1, -1), 'GRP'),)), + 'ORU_R32': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PD1', SEGMENTS['PD1'], (0, 1), 'SEG'), + ('ORU_R32_VISIT', GROUPS['ORU_R32_VISIT'], (0, 1), 'GRP'), + ('ORC', SEGMENTS['ORC'], (1, 1), 'SEG'), + ('OBR', SEGMENTS['OBR'], (1, 1), 'SEG'), + ('NTE', SEGMENTS['NTE'], (0, -1), 'SEG'), + ('ORU_R32_TIMING_QTY', GROUPS['ORU_R32_TIMING_QTY'], (0, -1), 'GRP'), + ('ORU_R32_OBSERVATION', GROUPS['ORU_R32_OBSERVATION'], (1, -1), 'GRP'),)), } diff --git a/hl7apy/v2_5_1/groups.py b/hl7apy/v2_5_1/groups.py index 1ef5caf..f932dc4 100644 --- a/hl7apy/v2_5_1/groups.py +++ b/hl7apy/v2_5_1/groups.py @@ -3154,6 +3154,108 @@ 'VXX_V02_PATIENT': ('sequence', (['PID', SEGMENTS['PID'], (1, 1), 'SEG'], ['NK1', SEGMENTS['NK1'], (0, -1), 'SEG'],)), + 'MDM_T03_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T03_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T03_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T04_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T04_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T04_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T04_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T05_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T05_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T05_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T06_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T06_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T06_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T06_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T07_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T07_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T07_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T08_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T08_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T08_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T08_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T09_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T09_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T09_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T10_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T10_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T10_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T10_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T11_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T11_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T11_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R31_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'ORU_R31_TIMING_QTY': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R31_VISIT': ('sequence', + (['PV1', SEGMENTS['PV1'], (1, 1), 'SEG'], + ['PV2', SEGMENTS['PV2'], (0, 1), 'SEG'],)), + 'ORU_R32_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'ORU_R32_TIMING_QTY': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R32_VISIT': ('sequence', + (['PV1', SEGMENTS['PV1'], (1, 1), 'SEG'], + ['PV2', SEGMENTS['PV2'], (0, 1), 'SEG'],)), } for k, v in iteritems(GROUPS): for item in v[1]: diff --git a/hl7apy/v2_5_1/messages.py b/hl7apy/v2_5_1/messages.py index 366d4e7..2adb190 100644 --- a/hl7apy/v2_5_1/messages.py +++ b/hl7apy/v2_5_1/messages.py @@ -1697,4 +1697,102 @@ ('QRD', SEGMENTS['QRD'], (1, 1), 'SEG'), ('QRF', SEGMENTS['QRF'], (0, 1), 'SEG'), ('VXX_V02_PATIENT', GROUPS['VXX_V02_PATIENT'], (1, -1), 'GRP'),)), + 'MDM_T03': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T03_COMMON_ORDER', GROUPS['MDM_T03_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T04': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T04_COMMON_ORDER', GROUPS['MDM_T04_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (0, 1), 'SEG'), + ('MDM_T04_OBXNTE', GROUPS['MDM_T04_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T05': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T05_COMMON_ORDER', GROUPS['MDM_T05_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T06': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T06_COMMON_ORDER', GROUPS['MDM_T06_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T06_OBXNTE', GROUPS['MDM_T06_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T07': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T07_COMMON_ORDER', GROUPS['MDM_T07_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T08': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T08_COMMON_ORDER', GROUPS['MDM_T08_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T08_OBXNTE', GROUPS['MDM_T08_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T09': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T09_COMMON_ORDER', GROUPS['MDM_T09_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T10': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T10_COMMON_ORDER', GROUPS['MDM_T10_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T10_OBXNTE', GROUPS['MDM_T10_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T11': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T11_COMMON_ORDER', GROUPS['MDM_T11_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'ORU_R31': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PD1', SEGMENTS['PD1'], (0, 1), 'SEG'), + ('ORU_R31_VISIT', GROUPS['ORU_R31_VISIT'], (0, 1), 'GRP'), + ('ORC', SEGMENTS['ORC'], (1, 1), 'SEG'), + ('OBR', SEGMENTS['OBR'], (1, 1), 'SEG'), + ('NTE', SEGMENTS['NTE'], (0, -1), 'SEG'), + ('ORU_R31_TIMING_QTY', GROUPS['ORU_R31_TIMING_QTY'], (0, -1), 'GRP'), + ('ORU_R31_OBSERVATION', GROUPS['ORU_R31_OBSERVATION'], (1, -1), 'GRP'),)), + 'ORU_R32': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PD1', SEGMENTS['PD1'], (0, 1), 'SEG'), + ('ORU_R32_VISIT', GROUPS['ORU_R32_VISIT'], (0, 1), 'GRP'), + ('ORC', SEGMENTS['ORC'], (1, 1), 'SEG'), + ('OBR', SEGMENTS['OBR'], (1, 1), 'SEG'), + ('NTE', SEGMENTS['NTE'], (0, -1), 'SEG'), + ('ORU_R32_TIMING_QTY', GROUPS['ORU_R32_TIMING_QTY'], (0, -1), 'GRP'), + ('ORU_R32_OBSERVATION', GROUPS['ORU_R32_OBSERVATION'], (1, -1), 'GRP'),)), } diff --git a/hl7apy/v2_6/groups.py b/hl7apy/v2_6/groups.py index db166bb..385fe23 100644 --- a/hl7apy/v2_6/groups.py +++ b/hl7apy/v2_6/groups.py @@ -3502,6 +3502,108 @@ 'VXX_V02_PATIENT': ('sequence', (['PID', SEGMENTS['PID'], (1, 1), 'SEG'], ['NK1', SEGMENTS['NK1'], (0, -1), 'SEG'],)), + 'MDM_T03_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T03_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T03_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T04_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T04_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T04_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T04_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T05_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T05_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T05_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T06_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T06_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T06_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T06_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T07_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T07_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T07_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T08_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T08_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T08_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T08_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T09_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T09_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T09_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T10_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T10_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T10_OBXNTE': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T10_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T11_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T11_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T11_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R31_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'ORU_R31_TIMING_QTY': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R31_VISIT': ('sequence', + (['PV1', SEGMENTS['PV1'], (1, 1), 'SEG'], + ['PV2', SEGMENTS['PV2'], (0, 1), 'SEG'],)), + 'ORU_R32_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'ORU_R32_TIMING_QTY': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R32_VISIT': ('sequence', + (['PV1', SEGMENTS['PV1'], (1, 1), 'SEG'], + ['PV2', SEGMENTS['PV2'], (0, 1), 'SEG'],)), } for k, v in iteritems(GROUPS): for item in v[1]: diff --git a/hl7apy/v2_6/messages.py b/hl7apy/v2_6/messages.py index 83d42de..bba4459 100644 --- a/hl7apy/v2_6/messages.py +++ b/hl7apy/v2_6/messages.py @@ -1966,4 +1966,117 @@ ('QRD', SEGMENTS['QRD'], (1, 1), 'SEG'), ('QRF', SEGMENTS['QRF'], (0, 1), 'SEG'), ('VXX_V02_PATIENT', GROUPS['VXX_V02_PATIENT'], (1, -1), 'GRP'),)), + 'MDM_T03': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T03_COMMON_ORDER', GROUPS['MDM_T03_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T04': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T04_COMMON_ORDER', GROUPS['MDM_T04_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T04_OBXNTE', GROUPS['MDM_T04_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T05': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T05_COMMON_ORDER', GROUPS['MDM_T05_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T06': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T06_COMMON_ORDER', GROUPS['MDM_T06_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T06_OBXNTE', GROUPS['MDM_T06_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T07': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T07_COMMON_ORDER', GROUPS['MDM_T07_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T08': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T08_COMMON_ORDER', GROUPS['MDM_T08_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T08_OBXNTE', GROUPS['MDM_T08_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T09': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T09_COMMON_ORDER', GROUPS['MDM_T09_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'MDM_T10': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T10_COMMON_ORDER', GROUPS['MDM_T10_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('MDM_T10_OBXNTE', GROUPS['MDM_T10_OBXNTE'], (1, -1), 'GRP'),)), + 'MDM_T11': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T11_COMMON_ORDER', GROUPS['MDM_T11_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'),)), + 'ORU_R31': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PD1', SEGMENTS['PD1'], (0, 1), 'SEG'), + ('OBX', SEGMENTS['OBX'], (0, -1), 'SEG'), + ('ORU_R31_VISIT', GROUPS['ORU_R31_VISIT'], (0, 1), 'GRP'), + ('ORC', SEGMENTS['ORC'], (1, 1), 'SEG'), + ('OBR', SEGMENTS['OBR'], (1, 1), 'SEG'), + ('NTE', SEGMENTS['NTE'], (0, -1), 'SEG'), + ('ROL', SEGMENTS['ROL'], (0, -1), 'SEG'), + ('ORU_R31_TIMING_QTY', GROUPS['ORU_R31_TIMING_QTY'], (0, -1), 'GRP'), + ('ORU_R31_OBSERVATION', GROUPS['ORU_R31_OBSERVATION'], (1, -1), 'GRP'),)), + 'ORU_R32': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PD1', SEGMENTS['PD1'], (0, 1), 'SEG'), + ('OBX', SEGMENTS['OBX'], (0, -1), 'SEG'), + ('ORU_R32_VISIT', GROUPS['ORU_R32_VISIT'], (0, 1), 'GRP'), + ('ORC', SEGMENTS['ORC'], (1, 1), 'SEG'), + ('OBR', SEGMENTS['OBR'], (1, 1), 'SEG'), + ('NTE', SEGMENTS['NTE'], (0, -1), 'SEG'), + ('ROL', SEGMENTS['ROL'], (0, -1), 'SEG'), + ('ORU_R32_TIMING_QTY', GROUPS['ORU_R32_TIMING_QTY'], (0, -1), 'GRP'), + ('ORU_R32_OBSERVATION', GROUPS['ORU_R32_OBSERVATION'], (1, -1), 'GRP'),)), } diff --git a/hl7apy/v2_7/groups.py b/hl7apy/v2_7/groups.py index c4910e1..0ccf57c 100644 --- a/hl7apy/v2_7/groups.py +++ b/hl7apy/v2_7/groups.py @@ -4114,6 +4114,118 @@ 'VXU_V04_TIMING': ('sequence', (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T03_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T03_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T03_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T04_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T04_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T04_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T04_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T05_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T05_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T05_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T06_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T06_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T06_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T06_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T07_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T07_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T07_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T08_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T08_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T08_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T08_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T09_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T09_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T09_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T10_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T10_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T10_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T10_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'MDM_T11_COMMON_ORDER': ('sequence', + (['ORC', SEGMENTS['ORC'], (1, 1), 'SEG'], + ['MDM_T11_TIMING', None, (0, -1), 'GRP'], + ['OBR', SEGMENTS['OBR'], (1, 1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'MDM_T11_TIMING': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R31_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['PRT', SEGMENTS['PRT'], (0, -1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'ORU_R31_PATIENT_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['PRT', SEGMENTS['PRT'], (0, -1), 'SEG'],)), + 'ORU_R31_TIMING_QTY': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R31_VISIT': ('sequence', + (['PV1', SEGMENTS['PV1'], (1, 1), 'SEG'], + ['PV2', SEGMENTS['PV2'], (0, 1), 'SEG'], + ['PRT', SEGMENTS['PRT'], (0, -1), 'SEG'],)), + 'ORU_R32_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['PRT', SEGMENTS['PRT'], (0, -1), 'SEG'], + ['NTE', SEGMENTS['NTE'], (0, -1), 'SEG'],)), + 'ORU_R32_PATIENT_OBSERVATION': ('sequence', + (['OBX', SEGMENTS['OBX'], (1, 1), 'SEG'], + ['PRT', SEGMENTS['PRT'], (0, -1), 'SEG'],)), + 'ORU_R32_TIMING_QTY': ('sequence', + (['TQ1', SEGMENTS['TQ1'], (1, 1), 'SEG'], + ['TQ2', SEGMENTS['TQ2'], (0, -1), 'SEG'],)), + 'ORU_R32_VISIT': ('sequence', + (['PV1', SEGMENTS['PV1'], (1, 1), 'SEG'], + ['PV2', SEGMENTS['PV2'], (0, 1), 'SEG'], + ['PRT', SEGMENTS['PRT'], (0, -1), 'SEG'],)), } for k, v in iteritems(GROUPS): diff --git a/hl7apy/v2_7/messages.py b/hl7apy/v2_7/messages.py index 7e4614b..7de06c9 100644 --- a/hl7apy/v2_7/messages.py +++ b/hl7apy/v2_7/messages.py @@ -1863,4 +1863,128 @@ ('GT1', SEGMENTS['GT1'], (0, -1), 'SEG'), ('VXU_V04_INSURANCE', GROUPS['VXU_V04_INSURANCE'], (0, -1), 'GRP'), ('VXU_V04_ORDER', GROUPS['VXU_V04_ORDER'], (0, -1), 'GRP'),)), + 'MDM_T03': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T03_COMMON_ORDER', GROUPS['MDM_T03_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('CON', SEGMENTS['CON'], (0, -1), 'SEG'),)), + 'MDM_T04': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T04_COMMON_ORDER', GROUPS['MDM_T04_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('CON', SEGMENTS['CON'], (0, -1), 'SEG'), + ('MDM_T04_OBSERVATION', GROUPS['MDM_T04_OBSERVATION'], (1, -1), 'GRP'),)), + 'MDM_T05': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T05_COMMON_ORDER', GROUPS['MDM_T05_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('CON', SEGMENTS['CON'], (0, -1), 'SEG'),)), + 'MDM_T06': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T06_COMMON_ORDER', GROUPS['MDM_T06_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('CON', SEGMENTS['CON'], (0, -1), 'SEG'), + ('MDM_T06_OBSERVATION', GROUPS['MDM_T06_OBSERVATION'], (1, -1), 'GRP'),)), + 'MDM_T07': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T07_COMMON_ORDER', GROUPS['MDM_T07_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('CON', SEGMENTS['CON'], (0, -1), 'SEG'),)), + 'MDM_T08': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T08_COMMON_ORDER', GROUPS['MDM_T08_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('CON', SEGMENTS['CON'], (0, -1), 'SEG'), + ('MDM_T08_OBSERVATION', GROUPS['MDM_T08_OBSERVATION'], (1, -1), 'GRP'),)), + 'MDM_T09': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T09_COMMON_ORDER', GROUPS['MDM_T09_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('CON', SEGMENTS['CON'], (0, -1), 'SEG'),)), + 'MDM_T10': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T10_COMMON_ORDER', GROUPS['MDM_T10_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('CON', SEGMENTS['CON'], (0, -1), 'SEG'), + ('MDM_T10_OBSERVATION', GROUPS['MDM_T10_OBSERVATION'], (1, -1), 'GRP'),)), + 'MDM_T11': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('EVN', SEGMENTS['EVN'], (1, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PV1', SEGMENTS['PV1'], (1, 1), 'SEG'), + ('MDM_T11_COMMON_ORDER', GROUPS['MDM_T11_COMMON_ORDER'], (0, -1), 'GRP'), + ('TXA', SEGMENTS['TXA'], (1, 1), 'SEG'), + ('CON', SEGMENTS['CON'], (0, -1), 'SEG'),)), + 'ORU_R31': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PD1', SEGMENTS['PD1'], (0, 1), 'SEG'), + ('PRT', SEGMENTS['PRT'], (0, -1), 'SEG'), + ('ORU_R31_PATIENT_OBSERVATION', GROUPS['ORU_R31_PATIENT_OBSERVATION'], (0, -1), 'GRP'), + ('ORU_R31_VISIT', GROUPS['ORU_R31_VISIT'], (0, 1), 'GRP'), + ('ORC', SEGMENTS['ORC'], (1, 1), 'SEG'), + ('OBR', SEGMENTS['OBR'], (1, 1), 'SEG'), + ('NTE', SEGMENTS['NTE'], (0, -1), 'SEG'), + ('PRT', SEGMENTS['PRT'], (0, -1), 'SEG'), + ('ORU_R31_TIMING_QTY', GROUPS['ORU_R31_TIMING_QTY'], (0, -1), 'GRP'), + ('ORU_R31_OBSERVATION', GROUPS['ORU_R31_OBSERVATION'], (1, -1), 'GRP'),)), + 'ORU_R32': ('sequence', + (('MSH', SEGMENTS['MSH'], (1, 1), 'SEG'), + ('SFT', SEGMENTS['SFT'], (0, -1), 'SEG'), + ('UAC', SEGMENTS['UAC'], (0, 1), 'SEG'), + ('PID', SEGMENTS['PID'], (1, 1), 'SEG'), + ('PD1', SEGMENTS['PD1'], (0, 1), 'SEG'), + ('PRT', SEGMENTS['PRT'], (0, -1), 'SEG'), + ('ORU_R32_PATIENT_OBSERVATION', GROUPS['ORU_R32_PATIENT_OBSERVATION'], (0, -1), 'GRP'), + ('ORU_R32_VISIT', GROUPS['ORU_R32_VISIT'], (0, 1), 'GRP'), + ('ORC', SEGMENTS['ORC'], (1, 1), 'SEG'), + ('OBR', SEGMENTS['OBR'], (1, 1), 'SEG'), + ('NTE', SEGMENTS['NTE'], (0, -1), 'SEG'), + ('PRT', SEGMENTS['PRT'], (0, -1), 'SEG'), + ('ORU_R32_TIMING_QTY', GROUPS['ORU_R32_TIMING_QTY'], (0, -1), 'GRP'), + ('ORU_R32_OBSERVATION', GROUPS['ORU_R32_OBSERVATION'], (1, -1), 'GRP'),)), } diff --git a/hl7apy/v2_8/__init__.py b/hl7apy/v2_8/__init__.py index 30cfd47..34927c8 100644 --- a/hl7apy/v2_8/__init__.py +++ b/hl7apy/v2_8/__init__.py @@ -30,7 +30,7 @@ from .groups import GROUPS from .tables import TABLES -from ..v2_7.base_datatypes import ST, FT, ID, IS, TX, GTS, SNM +from .base_datatypes import ST, FT, ID, IS, TX, GTS, SNM from hl7apy.exceptions import ChildNotFound ELEMENTS = {'Message': MESSAGES, 'Group': GROUPS, 'Segment': SEGMENTS, diff --git a/hl7apy/v2_8/base_datatypes.py b/hl7apy/v2_8/base_datatypes.py new file mode 100644 index 0000000..e8c02b4 --- /dev/null +++ b/hl7apy/v2_8/base_datatypes.py @@ -0,0 +1,134 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2012-2018, CRS4 +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +from __future__ import absolute_import + +import re + +from hl7apy import get_default_encoding_chars +from hl7apy.base_datatypes import TextualDataType as BaseTextualDataType + + +class TextualDataType(BaseTextualDataType): + + def _get_translations(self, encoding_chars): + escape_char = encoding_chars['ESCAPE'] + try: + return ((encoding_chars['FIELD'], '{esc}F{esc}'.format(esc=escape_char)), + (encoding_chars['COMPONENT'], '{esc}S{esc}'.format(esc=escape_char)), + (encoding_chars['SUBCOMPONENT'], '{esc}T{esc}'.format(esc=escape_char)), + (encoding_chars['REPETITION'], '{esc}R{esc}'.format(esc=escape_char)), + (encoding_chars['TRUNCATION'], '{esc}L{esc}'.format(esc=escape_char)),) + except KeyError: + return ((encoding_chars['FIELD'], '{esc}F{esc}'.format(esc=escape_char)), + (encoding_chars['COMPONENT'], '{esc}S{esc}'.format(esc=escape_char)), + (encoding_chars['SUBCOMPONENT'], '{esc}T{esc}'.format(esc=escape_char)), + (encoding_chars['REPETITION'], '{esc}R{esc}'.format(esc=escape_char)),) + + def _get_escape_char_regex(self, escape_char): + return r'(?