@fitpeo/rtm-module
v0.4.2
Published
Patient pain management canvas with question list
Downloads
30
Keywords
Readme
Installation
Using npm:
$ npm i @fitpeo/rtm-module
Usage Of Pain Management
import { useRef, useState } from "react";
import {
PainManagement,
AddictionMedicine,
MentalHealth,
} from "@fitpeo/rtm-module";
import SamplePMAnswers from "./SamplePMAnswers.json";
import SampleAMAnswers from "./SampleAMAnswers.json";
import SampleMHAnswers from "./SampleMHAnswers.json";
// to show these details at the top of PDF report
const patientDetails = {
name: "John Selenki",
dob: "01-Jan-1991",
caretaker: "caretaker name",
rtmProvider: "RTM Provider name",
planCreatedDate: "04-Sep-2023",
followUpDate: "04-Oct-3023",
icds: "a1, a2, a3",
};
const App = () => {
const rtmRef = useRef(null);
const [loading, setLoading] = useState(false);
const getData = (data) => {
setLoading(true);
setTimeout(() => {
console.log(data);
setLoading(false);
rtmRef.current.reset();
}, 2000);
};
return (
<>
{/* Editable */}
<PainManagement
ref={rtmRef}
loading={loading}
getFinalAnswers={getData}
/>
{/* Only View Mode */}
<PainManagement
viewable
defaultAnswers={SamplePMAnswers}
patientDetails={patientDetails}
/>
<AddictionMedicine
ref={rtmRef}
loading={loading}
getFinalAnswers={getData}
/>
<AddictionMedicine
viewable
defaultAnswers={SampleAMAnswers}
patientDetails={patientDetails}
/>
<MentalHealth ref={rtmRef} loading={loading} getFinalAnswers={getData} />
<MentalHealth
viewable
defaultAnswers={SampleMHAnswers}
patientDetails={patientDetails}
/>
</>
);
};
export default App;