feat(MED-161): store more fields about medipost analysis response

This commit is contained in:
2025-09-17 11:15:55 +03:00
parent cee37178df
commit 7af6aa438e
4 changed files with 27 additions and 4 deletions

View File

@@ -145,7 +145,7 @@ export type MedipostPublicMessageResponse = IMedipostResponseXMLBase & {
};
export type UuringuVastus = {
VastuseVaartus: number; // text according to docs, but based on examples and logically, float
VastuseVaartus: string; // numeric or text like 'Negatiivne'
VastuseAeg: string;
NormYlem?: {
'#text': number;

View File

@@ -686,7 +686,9 @@ export type Database = {
norm_upper_included: boolean | null
original_response_element: Json
response_time: string
response_value: number
response_value: number | null
response_value_is_negative?: boolean | null
status: string
unit: string | null
updated_at: string | null
}
@@ -704,7 +706,9 @@ export type Database = {
norm_upper_included?: boolean | null
original_response_element: Json
response_time: string
response_value: number
response_value: number | null
response_value_is_negative?: boolean | null
status: string
unit?: string | null
updated_at?: string | null
}
@@ -722,7 +726,9 @@ export type Database = {
norm_upper_included?: boolean | null
original_response_element?: Json
response_time?: string
response_value?: number
response_value?: number | null
response_value_is_negative?: boolean | null
status: string
unit?: string | null
updated_at?: string | null
}
@@ -1264,6 +1270,8 @@ export type Database = {
action: string
xml: string
has_analysis_results: boolean
medipost_external_order_id: string
medipost_private_message_id: string
medusa_order_id: string
response_xml: string
has_error: boolean
@@ -1272,6 +1280,8 @@ export type Database = {
action: string
xml: string
has_analysis_results: boolean
medipost_external_order_id: string
medipost_private_message_id: string
medusa_order_id: string
response_xml: string
has_error: boolean

View File

@@ -0,0 +1,11 @@
-- store extra audit info
ALTER TABLE medreport.medipost_actions ADD COLUMN medipost_private_message_id TEXT;
ALTER TABLE medreport.medipost_actions ADD COLUMN medipost_external_order_id TEXT;
-- store status info for frontend texts
ALTER TABLE medreport.analysis_response_elements ADD COLUMN status TEXT;
-- cancelled orders
ALTER TABLE medreport.analysis_response_elements ALTER COLUMN response_time DROP NOT NULL;
ALTER TABLE medreport.analysis_response_elements ALTER COLUMN response_value DROP NOT NULL;
ALTER TABLE medreport.analysis_response_elements ALTER COLUMN comment DROP NOT NULL;

View File

@@ -0,0 +1,2 @@
ALTER TABLE medreport.analysis_response_elements
ADD COLUMN response_value_is_negative BOOLEAN;