syntax = "proto3"; package primary.connect; option go_package = "primary.connect"; import "google/protobuf/timestamp.proto"; import "address.proto"; import "coded_value.proto"; import "device.proto"; import "identifier.proto"; import "meta.proto"; import "patient.proto"; import "phone_number.proto"; import "provider.proto"; import "result.proto"; import "specimen.proto"; import "visit.proto"; import "medication_administration.proto"; message Order { message Order { message Facility { string name = 1; Address address = 2; repeated PhoneNumber phone_numbers = 3; } message Diagnosis { enum Type { TYPE_UNKNOWN = 0; TYPE_ADMITTING = 1; TYPE_FINAL = 2; TYPE_SELF = 3; TYPE_WORKING = 4; TYPE_PRINCIPAL = 5; } CodedValue code = 1; // Code for the diagnosis Type type = 2; // Type of the diagnosis google.protobuf.Timestamp documented_date_time = 3; // Timestamp of the the diagnosis was documented } message ClinicalInfo { CodedValue code = 1; string value = 2; // Value of the information element. For AOEs, this is typically the full answer string units = 3; // Units of the value. If the Value is a time range, this may be "WK" string abbreviation = 4; // Abbreviation of the value of the information element. Typically only present for text answer AOEs repeated string notes = 5; // Notes related to the clinical info } enum Status { STATUS_UNKNOWN = 0; STATUS_UPDATE = 1; STATUS_CANCEL = 2; STATUS_RESULTED = 3; STATUS_NEW = 4; STATUS_REPORTED = 5; } enum Priority { PRIORITY_UNKNOWN = 0; PRIORITY_ASAP = 1; PRIORITY_ROUTINE = 2; PRIORITY_PREOPERATIVE = 3; PRIORITY_TIMING_CRITICAL = 4; PRIORITY_STAT = 5; } enum ResultStatus { UNAVAILABLE = 0; PRELIMINARY = 1; IN_PROCESS = 2; CORRECTED = 3; CANCELED = 4; FINAL = 5; } enum ResponseFlag { /* Increasing specificity, values incorporate previous options */ /* HL7 Table 0121 */ UNKNOWN = 0; EXCEPTIONS = 1; REPLACEMENTS = 2; ASSOCIATED_SEGMENTS = 3; CONFIRMATIONS = 4; ACKNOWLEDGEMENT = 5; } string id = 1; // ID of the order assigned by the placing system string application_order_id = 2; // ID assigned by the application fulfilling the order Status status = 3; // The status of an order. google.protobuf.Timestamp transaction_date_time = 4; // Timestamp when the order was placed google.protobuf.Timestamp collection_date_time = 5; // Timestamp when the specimen was collected google.protobuf.Timestamp completion_date_time = 6; // Timestamp when the results were composed into a report and released. string expiration_date = 7; // YYYY-MM-DD, Date when the order becomes invalid Specimen specimen = 8; CodedValue procedure = 9; // Procedure that was ordered Provider ordering_provider = 10; repeated Provider result_copy_providers = 11; // Array of providers to be copied on the results Facility ordering_facility = 12; // Facility this order was placed in Priority priority = 13; // Priority of the order repeated Diagnosis diagnoses = 14; // List of diagnoses associated with this order string clinical_comments = 15; // Clinically relevant comments regarding the order repeated string notes = 16; // Order-level notes repeated ClinicalInfo clinical_info = 17; // List of supplementary clinical information associated with the order. Often these are answers to Ask at Order Entry (AOE) questions. ResultStatus results_status = 18; // Current overall status of the order ResponseFlag response_flag = 19; // Specificity of the response requested from the receiving system repeated Identifier external_ids = 20; // May contain any number of ids related to this order repeated Result results = 21; // If this order already has a result, add the result here google.protobuf.Timestamp collection_start_date_time = 22; // Timestamp when the results collection was started. repeated MedicationAdministration medication_administrations = 23; // List of medication administrations google.protobuf.Timestamp accession_date_time = 24; // Timestamp when the specimen was received by the destination } message Subject { oneof subject { Patient patient = 1; Device device = 2; }; } Meta meta = 1; Patient patient = 2; // Deprecated in favor of the subject field Visit visit = 3; Order order = 4; Subject subject = 5; }