Skip to content
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

Modified the external results sample format #6694

Merged
merged 8 commits into from
Dec 6, 2023
3 changes: 3 additions & 0 deletions public/External-Results-Template.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
District,srf id,name,age,age in,gender,mobile number,address,ward,local body,local body type,source,Sample Collection Date,result date,test type,lab name,sample type,patient status,Is Repeat,patient category,result
Ernakulam,00/EKM/0000,Bodhi CSN,24,years,m,8888888888,"CSN HQ
Kochi, Kerala ",7,Poothrikka,grama panchayath,Secondary contact aparna,2020-10-14,2020-10-14,Antigen,Karothukuzhi Laboratory,Ag-SD_Biosensor_Standard_Q_COVID-19_Ag_detection_kit,Asymptomatic,NO,Cat 17: All individuals who wish to get themselves tested,Negative
2 changes: 1 addition & 1 deletion public/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"kasp_string": "KASP",
"kasp_full_string": "Karunya Arogya Suraksha Padhathi",
"sample_format_asset_import": "https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=11JaEhNHdyCHth4YQs_44YaRlP77Rrqe81VSEfg1glko&exportFormat=xlsx",
"sample_format_external_result_import": "https://docs.google.com/spreadsheets/d/17VfgryA6OYSYgtQZeXU9mp7kNvLySeEawvnLBO_1nuE/export?format=csv&id=17VfgryA6OYSYgtQZeXU9mp7kNvLySeEawvnLBO_1nuE",
"sample_format_external_result_import": "../../External-Results-Template.csv",
rithviknishad marked this conversation as resolved.
Show resolved Hide resolved
"enable_abdm": true
}
10 changes: 9 additions & 1 deletion src/Components/ExternalResult/ExternalResultUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ export default function ExternalResultUpload() {
}
};

const handleDownload = () => {
const link = document.createElement("a");
link.href = sample_format_external_result_import;
link.download = "sample_format";
link.click();
link.remove();
};
rithviknishad marked this conversation as resolved.
Show resolved Hide resolved
return (
<div className="px-4">
<PageTitle
Expand Down Expand Up @@ -111,7 +118,8 @@ export default function ExternalResultUpload() {
/>
<a
className="focus:ring-blue mx-auto mt-4 max-w-xs items-center rounded-md border border-primary-500 bg-white px-3 py-2 text-sm font-medium leading-4 text-primary-700 transition duration-150 ease-in-out hover:text-primary-500 hover:shadow focus:border-primary-300 focus:outline-none active:bg-gray-50 active:text-primary-800"
href={sample_format_external_result_import}
href="#"
onClick={handleDownload}
>
<i className="fa fa-download mr-1" aria-hidden="true"></i>{" "}
<span>{t("sample_format")}</span>
Expand Down
Loading