class Header(HeaderRecord): """ASTM header record. :param type: Record Type ID. Always ``H``. :type type: str :param delimeter: Delimiter Definition. Always ``\^&``. :type delimeter: str :param message_id: Message Control ID. Not used. :type message_id: None :param password: Access Password. Not used. :type password: None :param sender: Information about sender. Optional. :type sender: :class:`Sender` :param address: Sender Street Address. Not used. :type address: None :param reserved: Reserved Field. Not used. :type reserved: None :param phone: Sender Telephone Number. Not used. :type phone: None :param chars: Sender Characteristics. Not used. :type chars: None :param receiver: Information about receiver. Not used. :type receiver: None :param comments: Comments. Not used. :type comments: None :param processing_id: Processing ID. Always ``P``. :type processing_id: str :param version: ASTM Version Number. Always ``E 1394-97``. :type version: str :param timestamp: Date and Time of Message :type timestamp: datetime.datetime """ sender = ComponentField(Sender) processing_id = ConstantField(default='P') version = ConstantField(default='E 1394-97')
class Header(HeaderRecord): """ASTM header record. :param type: Record Type ID. Always ``H``. :type type: str :param delimeter: Delimiter Definition. Always ``\^&``. :type delimeter: str :param message_id: Message Control ID. Not used. :type message_id: None :param password: Access Password. Not used. :type password: None :param sender: Information about sender. Optional. :type sender: :class:`Sender` :param address: Sender Street Address. Not used. :type address: None :param reserved: Reserved Field. Not used. :type reserved: None :param phone: Sender Telephone Number. Not used. :type phone: None :param chars: Sender Characteristics. Not used. :type chars: None :param receiver: Information about receiver. Not used. :type receiver: None :param comments: Comments. Not used. :type comments: None :param processing_id: Processing ID. PR:(病人测试结果),QR:(质控测试结果),CR(定标结果),RQ(样本请求查询),QA(样本查询回应),SA(样本申请信息) :type processing_id: str :param version: ASTM Version Number. Always ``1394-97``. :type version: str :param timestamp: Date and Time of Message :type timestamp: datetime.datetime """ sender = ComponentField(Sender) processing_id = SetField(default='SA', values=('PR', 'QR', 'CR', 'RQ', 'QA', 'SA')) version = ConstantField(default='1394-97')
class Comment(CommonComment): """ASTM comment record. :param type: Record Type ID. Always ``C``. :type type: str :param seq: Sequence Number. Required. :type seq: int :param source: Comment source. Always ``I``. :type source: str :param data: free text value. Length: 90. :type data: str :param ctype: 注释类型. Length: 1, G(结果注释)、I(异常字符串) :type ctype: str """ source = ConstantField(default='I') data = TextField(length=90) ctype = SetField(values=('G', 'I'))
class Comment(CommonComment): """ASTM patient record. :param type: Record Type ID. Always ``C``. :type type: str :param seq: Sequence Number. Required. :type seq: int :param source: Comment source. Always ``L``. :type source: str :param data: Measurement value. Numeric, coded or free text value depending on result type. Required. Length: 1024. :type data: :class:`CommentData` :param ctype: Comment type. Always ``G``. :type ctype: str """ source = ConstantField(default='L') data = ComponentField(CommentData)
class Header(HeaderRecord): sender = ComponentField(Sender) processing_id = ConstantField(default='P') version = TextField(name='version', default='E 1394-97')
class Order(CommonOrder): """ASTM order record. :param type: Record Type ID. Always ``O``. :type type: str :param seq: Sequence Number. Required. :type seq: int :param sample_id: Sample ID number. Required. Length: 12. :type sample_id: str :param instrument: Instrument specimen ID. Not used. :type instrument: None :param test: Test information structure (aka Universal Test ID). :type test: :class:`Test` :param priority: Priority flag. Required. Possible values: - ``S``: stat; -``R``: routine. :type priority: str :param created_at: Ordered date and time. Required. :type created_at: datetime.datetime :param sampled_at: Specimen collection date and time. :type sampled_at: datetime.datetime :param collected_at: Collection end time. Not used. :type collected_at: None :param volume: Collection volume. Not used. :type volume: None :param collector: Collector ID. Not used. :type collector: None :param action_code: Action code. Required. Possible values: - ``C``: cancel works for specified tests; - ``A``: add tests to existed specimen; - ``N``: create new order; - ``R``: rerun tests for specified order; :type action_code: str :param danger_code: Danger code. Not used. :type danger_code: None :param clinical_info: Revelant clinical info. Not used. :type clinical_info: None :param delivered_at: Date/time specimen received. :type delivered_at: None :param biomaterial: Sample material code. Length: 20. :type biomaterial: str :param physician: Ordering Physician. Not used. :type physician: None :param physician_phone: Physician's phone number. Not used. :type physician_phone: None :param user_field_1: An optional field, it will be send back unchanged to the host along with the result. Length: 20. :type user_field_1: str :param user_field_2: An optional field, it will be send back unchanged to the host along with the result. Length: 1024. :type user_field_2: str :param laboratory_field_1: In multi-laboratory environment it will be used to indicate which laboratory entering the order. Length: 20. :type laboratory_field_1: str :param laboratory_field_2: Primary tube code. Length: 12. :type laboratory_field_2: str :param modified_at: Date and time of last result modification. Not used. :type modified_at: None :param instrument_charge: Instrument charge to computer system. Not used. :type instrument_charge: None :param instrument_section: Instrument section id. Not used. :type instrument_section: None :param report_type: Report type. Always ``O`` which means normal order request. :type report_type: str :param reserved: Reserved. Not used. :type reserved: None :param location_ward: Location ward of specimen collection. Not used. :type location_ward: None :param infection_flag: Nosocomial infection flag. Not used. :type infection_flag: None :param specimen_service: Specimen service. Not used. :type specimen_service: None :param laboratory: Production laboratory: in multi-laboratory environment indicates laboratory expected to process the order. Length: 20. :type laboratory: str """ action_code = SetField(default='N', values=('C', 'A', 'N', 'R')) created_at = DateTimeField(required=True) laboratory = TextField(length=20) laboratory_field_1 = TextField(length=20) report_type = ConstantField(default='O') sampled_at = DateTimeField() test = RepeatedComponentField(Test)
class CommonComment(CommentRecord): ctype = ConstantField(default='G')
priority = SetField(default='S', values=('S', 'R')) sample_id = TextField(required=True, length=12) user_field_1 = TextField(length=20) user_field_2 = TextField(length=1024) class CommonResult(ResultRecord): completed_at = DateTimeField(required=True) value = TextField(required=True, length=20) class CommonComment(CommentRecord): ctype = ConstantField(default='G') QueryRecord = Record.build(ConstantField(name='type', default='Q'), IntegerField(name='seq', default=1), NotUsedField(name='specimen'), NotUsedField(name='range_start'), NotUsedField(name='range_end'), NotUsedField(name='time_limits'), NotUsedField(name='period_start'), NotUsedField(name='period_end'), NotUsedField(name='physician_name'), NotUsedField(name='physician_phone'), NotUsedField(name='user_field_1'), NotUsedField(name='user_field_2'), NotUsedField(name='status_code')) class Terminator(TerminatorRecord):
class Order(CommonOrder): """ASTM order record. :param type: Record Type ID. Always ``O``. :type type: str :param seq: Sequence Number. Required. :type seq: int :param sample_id: Sample ID number. Required. Length: 12. :type sample_id: str :param instrument: Instrument specimen ID. :type instrument: :class:`Instrument` :param test: Test information structure (aka Universal Test ID). :type test: :class:`Test` :param priority: Priority flag. Required. Possible values: - ``S``: stat; -``R``: routine. :type priority: str :param created_at: Ordered date and time. Required. :type created_at: datetime.datetime :param sampled_at: Specimen collection date and time. :type sampled_at: datetime.datetime :param collected_at: Collection end time. Not used. :type collected_at: None :param volume: Collection volume. Not used. :type volume: None :param collector: Collector ID. Not used. :type collector: None :param action_code: Action code. Required. Possible values: - :const:`None`: normal order result; - ``Q``: quality control; :type action_code: str :param danger_code: Danger code. Not used. :type danger_code: None :param clinical_info: Revelant clinical info. Not used. :type clinical_info: None :param delivered_at: Date/time specimen received. :type delivered_at: None :param biomaterial: Sample material code. Length: 20. :type biomaterial: str :param physician: Ordering Physician. Not used. :type physician: None :param physician_phone: Physician's phone number. Not used. :type physician_phone: None :param user_field_1: An optional field, it will be send back unchanged to the host along with the result. Length: 20. :type user_field_1: str :param user_field_2: An optional field, it will be send back unchanged to the host along with the result. Length: 1024. :type user_field_2: str :param laboratory_field_1: Laboratory field #1. Not used. :type laboratory_field_1: None :param laboratory_field_2: Primary tube code. Length: 12. :type laboratory_field_2: str :param modified_at: Date and time of last result modification. Not used. :type modified_at: None :param instrument_charge: Instrument charge to computer system. Not used. :type instrument_charge: None :param instrument_section: Instrument section id. Not used. :type instrument_section: None :param report_type: Report type. Always ``F`` which means final order request. :type report_type: str :param reserved: Reserved. Not used. :type reserved: None :param location_ward: Location ward of specimen collection. Not used. :type location_ward: None :param infection_flag: Nosocomial infection flag. Not used. :type infection_flag: None :param specimen_service: Specimen service. Not used. :type specimen_service: None :param laboratory: Production laboratory. Not used. :type laboratory: None """ action_code = SetField(values=(None, 'Q')) instrument = ComponentField(Instrument) report_type = ConstantField(default='F') test = ComponentField(Test)