Skip to content

Commit

Permalink
fix: list additional errors in CSV Via HTTPs Data Quality page tech-b…
Browse files Browse the repository at this point in the history
  • Loading branch information
megin1989 committed Jan 10, 2025
1 parent 17ceabe commit e0f98ea
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
Binary file modified hub-prime/lib/techbd-udi-jooq-ingress.auto.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4038,4 +4038,55 @@ WHERE
GROUP BY
interaction_date, qe_name, it_vendor, scn, type
ORDER BY
interaction_date DESC;
interaction_date DESC;

/*******************************************************************************************
This view takes data from sat_interaction_fhir_request table to
provide a consolidated view of CCDA FHIR requests via CSV, including resource types,
interaction details, request attributes, and validation issues.
******************************************************************************************/
DROP VIEW IF EXISTS techbd_udi_ingress.interaction_csv_ccda_fhir_request CASCADE;
CREATE OR REPLACE VIEW techbd_udi_ingress.interaction_csv_ccda_fhir_request
AS SELECT hub_interaction_id AS interaction_id,
uri,
bundle_id,
created_at AS interaction_created_at,
created_by AS interaction_created_by,
provenance AS interaction_provenance,
sat_interaction_fhir_request_id AS sat_interaction_http_request_id,
nature,
tenant_id,
user_agent,
client_ip_address,
'application/json'::text AS content_type,
payload,
elaboration,
from_state,
to_state,
state_transition_reason,
created_at AS request_created_at,
created_by AS request_created_by,
provenance AS request_provenance,
issues_count,
resource_type_set AS resource_types,
interaction_start_time::text AS start_time,
interaction_end_time::text AS finish_time,
EXTRACT(epoch FROM interaction_end_time::timestamp without time zone - interaction_start_time::timestamp without time zone) * 1000::numeric AS duration_millisecs,
patient_id,
patient_mrn,
patient_mrn_source_system,
organization_id,
organization_name,
concat_ws('-'::text, tenant_id, organization_id, patient_mrn) AS source_mrn,
CASE
WHEN 'ServiceRequest' = ANY(string_to_array(resource_type_set, ', ')) OR 'Task' = ANY(string_to_array(resource_type_set, ', '))
THEN 'Referral'
WHEN 'Consent' = ANY(string_to_array(resource_type_set, ', '))
THEN 'Screening'
WHEN 'Condition' = ANY(string_to_array(resource_type_set, ', '))
THEN 'Assessment'
ELSE NULL
END AS bundle_resource_type,
source_hub_interaction_id
FROM techbd_udi_ingress.sat_interaction_fhir_request htt_req
WHERE source_type='CCDA';

0 comments on commit e0f98ea

Please sign in to comment.