import type { QuestionnaireResponse } from 'fhir/r4'; // The server's mark on an intake response it returned without its answers: the front desk's copy. Opened as a // form it would show every question unanswered, so screens say the answers are kept for the clinical team. export const ANSWERS_WITHHELD_TAG = { system: 'https://akashichealthrecords.com/fhir/CodeSystem/read-status', code: 'answers-withheld' }; export const ANSWERS_WITHHELD_MESSAGE = 'Answers are kept for the clinical team'; export const answersWithheld = (response: QuestionnaireResponse | undefined): boolean => (response?.meta?.tag ?? []).some((tag) => tag.system === ANSWERS_WITHHELD_TAG.system && tag.code === ANSWERS_WITHHELD_TAG.code);