Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Feat/pcr pcr test (#293)
Browse files Browse the repository at this point in the history
* add flag for enabling PCRs on testing facility

* statistic row as component

* refactor inline radio btns

* add testType radio switch

* add TestType enum; add testRecord for PCR

* change testType to enum

* update pcr result input

* used the new component StatisticDataRow in Statistics component

* added columns for PCR-Tests

* revised

* aligned text in the rows

* select duration for evaluation

* react on pcrEnabled

* api request for duration

* uncomment method

* show pcr results in statistics page

* display pcr results in statisticpage only if the testcenter provides them

* designed buttons and textfields

* api call for adding new statistic rows

* table for the statistic results

* delete statistic row

* new initial design for add statistic

* design for add statistic

* button add with fix width and height

* different urls for pcr and rat

* changed wording for PoC-NAT

* name PCR to PoC-NAT

* changed result values for PoC-NAT

* changed PoC-NAAT to PoC-NAAT-Test

* changed PoC-NAAT-Test to PoC-NAA-Test

* english translation

Co-authored-by: Gordon Grund <[email protected]>
Co-authored-by: Andreas Scheibal <[email protected]>
  • Loading branch information
3 people authored Feb 21, 2022
1 parent dd3b8fe commit 3861d4d
Show file tree
Hide file tree
Showing 19 changed files with 606 additions and 207 deletions.
48 changes: 45 additions & 3 deletions src/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import IQuickTest from './misc/quick-test';
import StatisticData from './misc/statistic-data';
import ITestResult from './misc/test-result';
import IQTArchiv from './misc/qt-archiv';
import { Sex, TestResult } from './misc/enum';
import { Sex, TestResult, TestType } from './misc/enum';
import { IUser, IGroupDetails } from './misc/user';

export const api = axios.create({
Expand Down Expand Up @@ -61,7 +61,8 @@ export interface IShortHashedGuid {

export interface IQuickTestDccAPIResponseModel {
dccConsent: boolean,
testResult: number
testResult: number,
testType: TestType
}

export interface IQuickTestAPIModel {
Expand Down Expand Up @@ -223,7 +224,7 @@ export const usePostQuickTest = (quickTest: IQuickTest | undefined, processId: s
testResultServerHash: quickTest.testResultHash ? quickTest.testResultHash : '0000000000000000000000000000000000000000000000000000000000000000',

diseaseAgentTargeted: '840539006',
testType: "LP217198-3",
testType: quickTest.testType,

dccConsent: quickTest.dccConsent,

Expand Down Expand Up @@ -444,6 +445,47 @@ export const useStatistics = (onSuccess?: (status: number) => void, onError?: (e

}

export const useGetStatisticsFromTo = (onSuccess?: (status: number) => void, onError?: (error: any) => void) => {

const { keycloak, initialized } = useKeycloak();
const [result, setResult] = React.useState<StatisticData>();

let balseUri = '/api/quickteststatistics';

const header = {
"Authorization": initialized ? `Bearer ${keycloak.token}` : "",
'Content-Type': 'application/json'
};


const getStatisticsFromTo = (dateFrom: Date, dateTo: Date) => {

if(!dateFrom) {
return;
}

let requestUri = balseUri + '?dateFrom=' + dateFrom.toISOString() + '&dateTo=' + dateTo.toISOString();

api.get(requestUri, { headers: header })
.then(response => {
setResult(response.data);
if (onSuccess) {
onSuccess(response?.status);
}
})
.catch(error => {
if (onError) {
onError(error);
}
});
}

return [
result,
getStatisticsFromTo
] as const;
}

export const useGetKeycloakConfig = (onSuccess?: (status: number) => void, onError?: (error: any) => void) => {

const [result, setResult] = React.useState<Keycloak.KeycloakConfig>();
Expand Down
45 changes: 45 additions & 0 deletions src/assets/SCSS/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ hr {
position: inherit;
width: 20px;
height: 20px;
margin-top: 0.1rem;;
}
.rdb-label {
height: 20px;
Expand Down Expand Up @@ -501,4 +502,48 @@ td {
display: flex;
align-self: baseline;
margin-left: 0.1rem;
}

.row-height-half {
height: 50%;
}

.space-five {
padding: 5px;
}

.width-one {
width: 1%;
}

.width-eight-houndred {
min-width: 800px;
}

.add-statistic {
width: 100%;
display: flex;
direction: row;
align-items: center;
box-shadow: 4px 2px 8px rgba(0, 0, 0, 0.15);
padding-top: 10px;
padding-bottom: 10px;
padding-left: 0px;
padding-right: 0px;
margin: 0px;
background-color: white;
flex-wrap: wrap;
}

.add-statistic-item {
display: flex;
direction: row;
width: 100%;
}

.btn-add-statistic-icon {
padding: 0px;
border: 0px;
width:24px;
height:24px;
}
17 changes: 13 additions & 4 deletions src/assets/i18n/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"data-submit": "Daten übermitteln",
"result-positive": "Positiv",
"result-negative": "Negativ",
"result-failed": "Failed",
"result-failed": "Ungültig",
"process-number": "Proben-ID",
"logout": "Logout",
"wrong-process-number": "Falsche Vorgangsnummer",
Expand All @@ -62,15 +62,19 @@
"statistics": "Auswertungen",
"statistics-menu-item": "Auswertungen",
"failed-report": "Testergebnisse",
"totalTestCount": "Gesamtanzahl der Tests",
"positiveTestCount": "Anzahl der positiven Tests",
"totalTestCount": "Gesamtanzahl Antigen-Schnelltests",
"positiveTestCount": "Anzahl positiver Antigen-Schnelltests",
"pcrTotalTestCount": "Gesamtanzahl PoC-NAA-Test(s)",
"pcrPositiveTestCount": "Anzahl positiver PoC-NAA-Test(s)",
"addStatisticRow": "Auswertung hinzufügen",
"today": "Heute",
"thisWeek": "Diese Woche",
"thisMonth": "Dieser Monat",
"successfull-transferred": "Die Daten wurden erfolgreich übermittelt",
"timerange": "Testzeitraum",
"from": "am",
"to": "bis",
"statisticFrom": "Von",
"filter-none": "alle",
"filter-record-result": "Testergebnis",
"search": "Suchen",
Expand All @@ -81,6 +85,7 @@
"standardised-name": "Standardisierter Name",
"standardised-name-tooltip": "Der standardisierte Name befindet sich in der untersten Zeile auf der Rückseite des Personalausweises. Es dürfen nur Großbuchstaben und \"<\" verwendet werden. Sonderzeichen, Umlaute und Zahlen sind nicht erlaubt.",
"testManufacturers": "Testhersteller und -name",
"pcrTestManufacturers": "PoC-NAA-Testsystem",
"testId-input-header": "Eingabe Proben-ID",
"error-processId-data-load": "Die eingegebene Proben-ID ist uns nicht bekannt!",
"ok": "OK",
Expand Down Expand Up @@ -145,5 +150,9 @@
"disclaimer-link": "https://map.schnelltestportal.de",
"disclaimer-text2-part1": "Um eine Teststelle für unser Schnelltestsuchportal freizuschalten, klicken Sie auf das Bearbeiten-Icon und aktivieren Sie das Kästchen <strong>Im Schnelltestsuchportal anzeigen</strong>.\n\nSo ermöglichen Sie Ihren Kunden, die Teststelle einfach unter ",
"disclaimer-text2-part2": " zu finden.\n\nSie können auch zusätzliche Informationen wie Öffnungszeiten oder Ihre Website hinterlegen.",
"disclaimer-do-not-show": "Benachrichtigung nicht mehr anzeigen."
"disclaimer-do-not-show": "Benachrichtigung nicht mehr anzeigen.",
"enablePcr": "PoC-NAA-Test erlauben",
"LP217198-3": "Antigen-Schnelltest",
"LP6464-4": "PoC-NAA-Test",
"test-type": "Testtyp"
}
24 changes: 21 additions & 3 deletions src/assets/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"data-privacy": "Dataprivacy",
"record-patient-data": "Record Patient Data",
"record-result": "Record Test Result",
"record-result2": "Record Patient Data",
"record-qr-scan": "Record QR Scan",
"welcome": "Welcome",
"process": "Process",
Expand All @@ -30,6 +31,8 @@
"email-address": "E-Mail Address",
"test-id": "Test-ID",
"test-name": "Test-Name",
"processing-consent-title": "Show test result in CWA (non-named test certificate)",
"patientdata-exclude-title": "Show test result in CWA (named test certificate)",
"processing-consent": "Consent to processing in CWA",
"bill-status": "bill status",
"data-privacy-approve": "Approve Dataprivacy",
Expand All @@ -40,7 +43,7 @@
"patient-data": "Patient data",
"cancel": "Cancel",
"data-submit": "Submit Data",
"result-positiv": "Positive",
"result-positive": "Positive",
"result-negative": "Negative",
"result-failed": "Failed",
"process-number": "Process number",
Expand All @@ -61,13 +64,17 @@
"failed-report": "Test Report",
"totalTestCount": "Total test count",
"positiveTestCount": "Positive test count",
"pcrTotalTestCount": "Total PoC-NAA-Test(s)",
"pcrPositiveTestCount": "Positive PoC-NAA-Test(s)",
"addStatisticRow": "Add statistic",
"today": "Today",
"thisWeek": "This week",
"thisMonth": "This month",
"successfull-transferred": "Data successfully transferred",
"timerange": "Timerange",
"from": "from",
"to": "to",
"statisticFrom": "From",
"filter-none": "all",
"filter-record-result": "testresult",
"search": "search",
Expand All @@ -76,10 +83,15 @@
"standardised-first-name": "Standardised Given name",
"standardised-name": "Standardised Family name",
"testManufacturers": "Test manufacturers and names",
"pcrTestManufacturers": "PoC-NAA-Testsystem",
"testId-input-header": "Process number input",
"error-processId-data-load": "The entered sample ID is not known!",
"ok": "OK",
"change-password": "Change Password",
"testZertifikat": "COVID test certificate",
"dccConsent": "Patient wants to have an official EU COVID test certificate (DCC)?",
"ja": "Yes",
"nein": "No",
"user-management": "User Management",
"user": "User",
"user-name": "Username",
Expand Down Expand Up @@ -113,6 +125,8 @@
"searchPortalWebsitePlaceholder": "www.example.de",
"searchPortalWebsiteTooltip": "tooltip",
"searchPortalOpeningHours": "Opening Hours",
"openening-hours-to-long-error": "Either the specified text is too long or it contains incorrect characters. 64 characters per line are allowed.",
"opening-hours-to-much-lines-error": "Only seven lines are allowed.",
"searchPortalAppointmentRequired": "Appointment Required",
"RAT-list-info": "The tests listed in the DCC selection are based on a list agreed at EU level and also include tests that are not reimbursable in Germany. The operator himself has to check the eligibility for reimbursement. Comparison with ",
"RAT-list-info-link": "https://antigentest.bfarm.de/ords/f?p=110:100:12807215185840:::::&tz=2:00",
Expand All @@ -127,6 +141,10 @@
"disclaimer-text1-part2": ".",
"disclaimer-link": "https://map.schnelltestportal.de",
"disclaimer-text2-part1": "To activate a test site for our rapid test search portal, click on the edit icon and activate the Show in the rapid test search portal box\n\nThis enables your customers to easily find the test site at ",
"disclaimer-text2-part2":".\n\nYou can also store additional information such as opening times or your website.",
"disclaimer-do-not-show": "Don't show notification again."
"disclaimer-text2-part2": ".\n\nYou can also store additional information such as opening times or your website.",
"disclaimer-do-not-show": "Don't show notification again.",
"enablePcr": "enable PoC-NAA-Test",
"LP217198-3": "RAT",
"LP6464-4": "PoC-NAA-Test",
"test-type": "Test type"
}
12 changes: 11 additions & 1 deletion src/components/modals/group-modal.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const emptyGroup: IGroupDetails = {
pocId: '',
name: '',
pocDetails: '',
enablePcr: false,
searchPortalConsent: true,
parentGroup: '',
website: '',
Expand Down Expand Up @@ -350,6 +351,15 @@ const GroupModal = (props: any) => {
maxLength={300}
/>

<FormGroupPermissionCkb controlId='formenablePcr' title={t('translation:enablePcr')}
//label={t('translation:for-counter')}
onChange={(evt: any) => updateSearchPortalConsent('enablePcr', evt.currentTarget.checked)}
type='checkbox'
checked={group.enablePcr}
/>

<hr />

{/* < FormGroupInput controlId='formBSNRInput' title={t('translation:bsnr')} placeholder={t('translation:bsnr-placeholder')}
value={group ? group.bsnr : ''}
onChange={(evt: any) => {
Expand All @@ -362,7 +372,7 @@ const GroupModal = (props: any) => {
pattern={utils.pattern.BSNR}
/> */}

<FormGroupPermissionCkb controlId='formRoleCounter' title={t('translation:searchPortalConsent')}
<FormGroupPermissionCkb controlId='formsearchPortalConsent' title={t('translation:searchPortalConsent')}
//label={t('translation:for-counter')}
onChange={(evt: any) => updateSearchPortalConsent('searchPortalConsent', evt.currentTarget.checked)}
type='checkbox'
Expand Down
13 changes: 10 additions & 3 deletions src/components/modules/form-group.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,17 @@ export const FormGroupPermissionCkb = (props: any) => {
)
}

export const FormGroupSexRadio = (props: any) => {
export const FormGroupInlineRadio = (props: any) => {

return (!props ? <></> :
<Form.Group as={Col} xs='12' sm='4' className='d-flex mb-0' controlId={props.controlId}>
<Form.Group
as={Col}
controlId={props.controlId}
className='d-flex mb-0'
xs='12'
sm={props.sm ? props.sm : '4'}
md={props.md}
>
<Form.Check className='d-flex align-self-center'>
<Form.Check.Input
className='rdb-input'
Expand All @@ -200,7 +207,7 @@ export const FormGroupSexRadio = (props: any) => {
onChange={props.onChange}
required={props.required}
/>
<Form.Label className='rdb-label mb-0'>{props.title}</Form.Label>
<Form.Label className='rdb-label mb-0 txt-no-wrap'>{props.title}</Form.Label>
</Form.Check>
</Form.Group>
)
Expand Down
8 changes: 4 additions & 4 deletions src/components/modules/person-data-inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import de from 'date-fns/locale/de';

import { Sex } from "../../misc/enum";
import { IPersonData } from "../../misc/quick-test";
import { FormGroupInput, FormGroupSexRadio } from "./form-group.component";
import { FormGroupInput, FormGroupInlineRadio } from "./form-group.component";

registerLocale('de', de)

Expand Down Expand Up @@ -177,18 +177,18 @@ const PersonInputs = (props: any) => {

<Col xs='7' sm='9' className='d-flex'>
<Row>
<FormGroupSexRadio controlId='sex-radio1' name="sex-radios" title={t('translation:male')}
<FormGroupInlineRadio controlId='sex-radio1' name="sex-radios" title={t('translation:male')}
checked={sex === Sex.MALE}
onChange={() => setSex(Sex.MALE)}
/>

<FormGroupSexRadio controlId='sex-radio2' name="sex-radios" title={t('translation:female')}
<FormGroupInlineRadio controlId='sex-radio2' name="sex-radios" title={t('translation:female')}
checked={sex === Sex.FEMALE}
onChange={() => setSex(Sex.FEMALE)}
required={true}
/>

<FormGroupSexRadio controlId='sex-radio3' name="sex-radios" title={t('translation:diverse')}
<FormGroupInlineRadio controlId='sex-radio3' name="sex-radios" title={t('translation:diverse')}
checked={sex === Sex.DIVERSE}
onChange={() => setSex(Sex.DIVERSE)}
/>
Expand Down
Loading

0 comments on commit 3861d4d

Please sign in to comment.