Skip to content

Commit

Permalink
feat: update insertion for multiple fields in diagnostics satellite t…
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-francis committed Jan 21, 2025
1 parent 1befab7 commit c9d5552
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@ provenance - Metadata providing the provenance or origin of the interac
Returns:
No return value. Inserts diagnostic records into the 'sat_interaction_fhir_session_diagnostic' table for each issue found in the payload.
*******************************************************************************************************************************/
DROP PROCEDURE IF EXISTS techbd_udi_ingress.insert_fhir_session_diagnostic(text,text,text,text,jsonb,text,text);
DROP PROCEDURE IF EXISTS techbd_udi_ingress.insert_fhir_session_diagnostic(text,text,text,text,jsonb,text,text,jsonb);
DROP PROCEDURE IF EXISTS techbd_udi_ingress.insert_fhir_session_diagnostic(text,text,text,text,jsonb,text,text,text,text,text);
CREATE OR REPLACE PROCEDURE techbd_udi_ingress.insert_fhir_session_diagnostic(
IN hub_interaction_id TEXT,
Expand Down Expand Up @@ -2206,10 +2206,10 @@ BEGIN
FOR session_diagnostic_set IN
SELECT
issue.value ->> 'severity'::text AS severity,
issue.value ->> 'message'::text AS message,
(issue.value -> 'location'::text) ->> 'line'::text AS line,
(issue.value -> 'location'::text) ->> 'column'::text AS "column",
(issue.value -> 'location'::text) ->> 'diagnostics'::text AS diagnostics,
issue.value ->> 'diagnostics'::text AS message,
((issue.value -> 'extension'::text) -> 0) ->> 'valueInteger'::text AS line,
((issue.value -> 'extension'::text) -> 1) ->> 'valueInteger'::text AS "column",
(issue.value -> 'location'::text) ->> 0 AS diagnostics,
(insert_fhir_session_diagnostic.payload -> 'response'::text) ->> 'encounteredAt'::text AS encounteredAt,
insert_fhir_session_diagnostic.elaboration
FROM LATERAL jsonb_array_elements(
Expand Down

0 comments on commit c9d5552

Please sign in to comment.