Skip to content

Commit

Permalink
Restructured Consent Records (#7946)
Browse files Browse the repository at this point in the history
  • Loading branch information
skks1212 committed Jun 7, 2024
1 parent 5f05c0c commit ed7b307
Show file tree
Hide file tree
Showing 11 changed files with 495 additions and 283 deletions.
15 changes: 15 additions & 0 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1370,3 +1370,18 @@ export const PATIENT_NOTES_THREADS = {
} as const;

export const RATION_CARD_CATEGORY = ["BPL", "APL", "NO_CARD"] as const;

export const DEFAULT_ALLOWED_EXTENSIONS = [
"image/*",
"video/*",
"audio/*",
"text/plain",
"text/csv",
"application/rtf",
"application/msword",
"application/vnd.oasis.opendocument.text",
"application/pdf",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.oasis.opendocument.spreadsheet,application/pdf",
];
23 changes: 22 additions & 1 deletion src/Components/Common/FilePreviewDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ type FilePreviewProps = {
fixedWidth?: boolean;
};

const previewExtensions = [
".html",
".htm",
".pdf",
".mp4",
".webm",
".jpg",
".jpeg",
".png",
".gif",
".webp",
];

const FilePreviewDialog = (props: FilePreviewProps) => {
const { show, onClose, file_state, setFileState, downloadURL, fileUrl } =
props;
Expand Down Expand Up @@ -130,13 +143,21 @@ const FilePreviewDialog = (props: FilePreviewProps) => {
}}
pageNumber={page}
/>
) : (
) : previewExtensions.includes(file_state.extension) ? (
<iframe
sandbox=""
title="Source Files"
src={fileUrl}
className="h-[75vh] w-full"
/>
) : (
<div className="flex h-full w-full flex-col items-center justify-center">
<CareIcon
icon="l-file"
className="mb-4 text-5xl text-gray-600"
/>
Can't preview this file. Try downloading it.
</div>
)}
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Notification from "../../Utils/Notifications.js";

import { BedModel, ConsentRecord, FacilityModel } from "./models";
import { BedModel, FacilityModel } from "./models";
import {
CONSULTATION_SUGGESTION,
DISCHARGE_REASONS,
Expand Down Expand Up @@ -119,7 +119,6 @@ type FormDetails = {
death_confirmed_doctor: string;
InvestigationAdvice: InvestigationType[];
procedures: ProcedureType[];
consent_records: ConsentRecord[];
};

const initForm: FormDetails = {
Expand Down Expand Up @@ -170,7 +169,6 @@ const initForm: FormDetails = {
death_confirmed_doctor: "",
InvestigationAdvice: [],
procedures: [],
consent_records: [],
};

const initError = Object.assign(
Expand Down
15 changes: 10 additions & 5 deletions src/Components/Facility/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,18 @@ export interface OptionsType {

export type PatientCategory = "Comfort Care" | "Mild" | "Moderate" | "Critical";

export type ConsentRecord = {
export interface PatientConsentModel {
id: string;
type: (typeof CONSENT_TYPE_CHOICES)[number]["id"];
patient_code_status?: (typeof CONSENT_PATIENT_CODE_STATUS_CHOICES)[number]["id"];
deleted?: boolean;
};
patient_code_status:
| (typeof CONSENT_PATIENT_CODE_STATUS_CHOICES)[number]["id"]
| null;
archived: boolean;
archived_by?: UserBareMinimum;
archived_date: string;
created_date: string;
created_by: UserBareMinimum;
}

export interface ConsultationModel {
encounter_date: string;
Expand Down Expand Up @@ -174,7 +180,6 @@ export interface ConsultationModel {
is_readmission?: boolean;
medico_legal_case?: boolean;
investigation?: InvestigationType[];
consent_records?: ConsentRecord[];
}

export interface PatientStatsModel {
Expand Down
Loading

0 comments on commit ed7b307

Please sign in to comment.