-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CT Adult and Child Pages #1
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,15 @@ import React from "react"; | |
import { Tabs, Tab, TabList, TabPanels, TabPanel } from "@carbon/react"; | ||
import styles from "../common.scss"; | ||
import { useTranslation } from "react-i18next"; | ||
import TabOne from "./tabs/tab-one.component"; | ||
import TabThree from "./tabs/tab-three.component"; | ||
import TabTwo from "./tabs/tab-two.component"; | ||
import CtAdultVisitForm from "./tabs/ct-adult-visit-form.component"; | ||
import CtAdultProblemsForm from "./tabs/ct-adult-problems-form"; | ||
import CtAdultOiForm from "./tabs/ct-adult-oi-form"; | ||
import CtAdultLabForm from "./tabs/ct-adult-lab-form"; | ||
import CtAdultImagingForm from "./tabs/ct-adult-imaging-form"; | ||
import CtAdultHospitalizationForm from "./tabs/ct-adult-hospitalization-form"; | ||
import CtAdultAllergyForm from "./tabs/ct-adult-allergy-form"; | ||
|
||
interface OverviewListProps { | ||
patientUuid: string; | ||
|
@@ -16,19 +22,35 @@ const CareAndTreatment: React.FC<OverviewListProps> = ({ patientUuid }) => { | |
<div className={styles.tabContainer}> | ||
<Tabs> | ||
<TabList contained> | ||
<Tab className="tab-12rem">{t("tabOne", "Tab One")}</Tab> | ||
<Tab>{t("tabTwo", "Tab Two")}</Tab> | ||
<Tab>{t("tabThree", "Tab Three")}</Tab> | ||
<Tab className="tab-12rem">{t("tabOne", "Visits")}</Tab> | ||
<Tab>{t("tabTwo", "Problems (Wahala)")}</Tab> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this intentional 😅 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LOL... of course. AI doesn't speak pigin yet |
||
<Tab>{t("tabThree", "OI Form")}</Tab> | ||
<Tab className="tab-12rem">{t("tabOne", "Lab")}</Tab> | ||
<Tab>{t("tabTwo", "Imaging")}</Tab> | ||
<Tab>{t("tabThree", "Hospitalizations")}</Tab> | ||
<Tab>{t("tabThree", "Allergies")}</Tab> | ||
</TabList> | ||
<TabPanels> | ||
<TabPanel> | ||
<TabOne patientUuid={patientUuid} /> | ||
<CtAdultVisitForm patientUuid={patientUuid} /> | ||
</TabPanel> | ||
<TabPanel> | ||
<TabTwo patientUuid={patientUuid} /> | ||
<CtAdultProblemsForm patientUuid={patientUuid} /> | ||
</TabPanel> | ||
<TabPanel> | ||
<TabThree patientUuid={patientUuid} /> | ||
<CtAdultOiForm patientUuid={patientUuid} /> | ||
</TabPanel> | ||
<TabPanel> | ||
<CtAdultLabForm patientUuid={patientUuid} /> | ||
</TabPanel> | ||
<TabPanel> | ||
<CtAdultImagingForm patientUuid={patientUuid} /> | ||
</TabPanel> | ||
<TabPanel> | ||
<CtAdultHospitalizationForm patientUuid={patientUuid} /> | ||
</TabPanel> | ||
<TabPanel> | ||
<CtAdultAllergyForm patientUuid={patientUuid} /> | ||
</TabPanel> | ||
</TabPanels> | ||
</Tabs> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import React, { useMemo } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { | ||
EmptyStateComingSoon, | ||
EncounterList, | ||
EncounterListColumn, | ||
getObsFromEncounter, | ||
} from "@ohri/openmrs-esm-ohri-commons-lib"; | ||
import { moduleName } from "../../index"; | ||
|
||
const CtAdultAllergyForm: React.FC<{ patientUuid: string }> = ({ | ||
patientUuid, | ||
}) => { | ||
const { t } = useTranslation(); | ||
const formName = "A - HIV Visit - Allergy Form"; | ||
const title = t("adultCtProblemsTab", "Allergies"); | ||
const encounterTypeUUID = "2dc31190-cf0e-4ab0-a5a1-6ad601d6ecc0"; | ||
|
||
const columns: EncounterListColumn[] = useMemo( | ||
() => [ | ||
{ | ||
key: "adverseEventMedication", | ||
header: t("adverseEventMedication", "Suspect drug"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"3cd95ed6-26fe-102b-80cb-0017a47871b2" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "adverseEventMedicationNonCoded", | ||
header: t("adverseEventMedicationNonCoded", "Suspect drug (Other)"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"2c62cce0-8b88-4b9e-8b22-c99c7ccc3e27" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "adverseEventEffect", | ||
header: t("adverseEventEffect", "Effect"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"3cd96052-26fe-102b-80cb-0017a47871b2" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "adverseEventActionTaken", | ||
header: t("adverseEventActionTaken", "Action taken"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"3cdc7e2c-26fe-102b-80cb-0017a47871b2" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "actions", | ||
header: t("actions", "Actions"), | ||
getValue: (encounter) => [ | ||
{ | ||
form: { name: formName, package: "maternal_health" }, | ||
encounterUuid: encounter.uuid, | ||
intent: "*", | ||
label: t("viewDetails", "View Details"), | ||
mode: "view", | ||
}, | ||
{ | ||
form: { name: formName, package: "maternal_health" }, | ||
encounterUuid: encounter.uuid, | ||
intent: "*", | ||
label: t("editForm", "Edit Form"), | ||
mode: "edit", | ||
}, | ||
], | ||
}, | ||
], | ||
[] | ||
); | ||
|
||
return ( | ||
<EncounterList | ||
patientUuid={patientUuid} | ||
encounterType={encounterTypeUUID} | ||
formList={[ | ||
{ | ||
name: formName, | ||
fixedIntent: "*", | ||
excludedIntents: [], | ||
}, | ||
]} | ||
columns={columns} | ||
description={title} | ||
headerTitle={title} | ||
launchOptions={{ | ||
displayText: "Add", | ||
moduleName: moduleName, | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default CtAdultAllergyForm; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import React, { useMemo } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { | ||
EmptyStateComingSoon, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This import is no longer necessary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh yes. Will clean it up |
||
EncounterList, | ||
EncounterListColumn, | ||
getObsFromEncounter, | ||
} from "@ohri/openmrs-esm-ohri-commons-lib"; | ||
import { moduleName } from "../../index"; | ||
|
||
const CtAdultHospitalizationForm: React.FC<{ patientUuid: string }> = ({ | ||
patientUuid, | ||
}) => { | ||
const { t } = useTranslation(); | ||
const formName = "A - HIV Visit - Problem Form"; | ||
const title = t("adultCtProblemsTab", "Problems"); | ||
const encounterTypeUUID = "2dc31190-cf0e-4ab0-a5a1-6ad601d6ecc0"; | ||
|
||
const columns: EncounterListColumn[] = useMemo( | ||
() => [ | ||
{ | ||
key: "chronicCareDiagnosis", | ||
header: t("chronicCareDiagnosis", "Chronic care diagnosis"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"bb7e04d8-3355-4fe8-9c87-98642eafab93" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "chronicCareDiagnosisNonCoded", | ||
header: t("chronicCareDiagnosisNonCoded", "Care diagnosis non coded"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"0814d34f-a6ab-408c-848b-c69c96b42f70" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "ctAdultComment", | ||
header: t("ctAdultComment", "Comments"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"3ce888c0-26fe-102b-80cb-0017a47871b2" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "emrMatchesPaper", | ||
header: t("emrMatchesPaper", "EMR matches paper"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"c8f6b4ae-600e-496c-b6b9-d6b395e13a1f" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "actions", | ||
header: t("actions", "Actions"), | ||
getValue: (encounter) => [ | ||
{ | ||
form: { name: formName, package: "maternal_health" }, | ||
encounterUuid: encounter.uuid, | ||
intent: "*", | ||
label: t("viewDetails", "View Details"), | ||
mode: "view", | ||
}, | ||
{ | ||
form: { name: formName, package: "maternal_health" }, | ||
encounterUuid: encounter.uuid, | ||
intent: "*", | ||
label: t("editForm", "Edit Form"), | ||
mode: "edit", | ||
}, | ||
], | ||
}, | ||
], | ||
[] | ||
); | ||
|
||
return ( | ||
<EncounterList | ||
patientUuid={patientUuid} | ||
encounterType={encounterTypeUUID} | ||
formList={[ | ||
{ | ||
name: formName, | ||
fixedIntent: "*", | ||
excludedIntents: [], | ||
}, | ||
]} | ||
columns={columns} | ||
description={title} | ||
headerTitle={title} | ||
launchOptions={{ | ||
displayText: "Add", | ||
moduleName: moduleName, | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default CtAdultHospitalizationForm; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import React, { useMemo } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { | ||
EmptyStateComingSoon, | ||
EncounterList, | ||
EncounterListColumn, | ||
getObsFromEncounter, | ||
} from "@ohri/openmrs-esm-ohri-commons-lib"; | ||
import { moduleName } from "../../index"; | ||
|
||
const CtAdultImagingForm: React.FC<{ patientUuid: string }> = ({ | ||
patientUuid, | ||
}) => { | ||
const { t } = useTranslation(); | ||
const formName = "A - HIV Visit - Problem Form"; | ||
const title = t("adultCtProblemsTab", "Problems"); | ||
const encounterTypeUUID = "2dc31190-cf0e-4ab0-a5a1-6ad601d6ecc0"; | ||
|
||
const columns: EncounterListColumn[] = useMemo( | ||
() => [ | ||
{ | ||
key: "chronicCareDiagnosis", | ||
header: t("chronicCareDiagnosis", "Chronic care diagnosis"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"bb7e04d8-3355-4fe8-9c87-98642eafab93" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "chronicCareDiagnosisNonCoded", | ||
header: t("chronicCareDiagnosisNonCoded", "Care diagnosis non coded"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"0814d34f-a6ab-408c-848b-c69c96b42f70" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "ctAdultComment", | ||
header: t("ctAdultComment", "Comments"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"3ce888c0-26fe-102b-80cb-0017a47871b2" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "emrMatchesPaper", | ||
header: t("emrMatchesPaper", "EMR matches paper"), | ||
getValue: (encounter) => { | ||
return getObsFromEncounter( | ||
encounter, | ||
"c8f6b4ae-600e-496c-b6b9-d6b395e13a1f" | ||
); | ||
}, | ||
}, | ||
{ | ||
key: "actions", | ||
header: t("actions", "Actions"), | ||
getValue: (encounter) => [ | ||
{ | ||
form: { name: formName, package: "maternal_health" }, | ||
encounterUuid: encounter.uuid, | ||
intent: "*", | ||
label: t("viewDetails", "View Details"), | ||
mode: "view", | ||
}, | ||
{ | ||
form: { name: formName, package: "maternal_health" }, | ||
encounterUuid: encounter.uuid, | ||
intent: "*", | ||
label: t("editForm", "Edit Form"), | ||
mode: "edit", | ||
}, | ||
], | ||
}, | ||
], | ||
[] | ||
); | ||
|
||
return ( | ||
<EncounterList | ||
patientUuid={patientUuid} | ||
encounterType={encounterTypeUUID} | ||
formList={[ | ||
{ | ||
name: formName, | ||
fixedIntent: "*", | ||
excludedIntents: [], | ||
}, | ||
]} | ||
columns={columns} | ||
description={title} | ||
headerTitle={title} | ||
launchOptions={{ | ||
displayText: "Add", | ||
moduleName: moduleName, | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default CtAdultImagingForm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change can be reverted. Not a blocker though cause it's being overriden by the resolution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roger that