Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-10-09 19:25:43 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
16dd47c1aa657a6f057691b41c38ac420c576246
16dd47c1
1 parent
c7927d51
feat. api수정으로 인한 field 변수 변경
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
42 deletions
web/src/api/api-doctor.ts
web/src/views/main/doctor/DoctorMenuContainer.tsx
web/src/views/main/doctor/DoctorMenuPresenter.tsx
web/src/views/main/doctor/DoctorMenuStyled.tsx
web/src/api/api-doctor.ts
View file @
16dd47c
...
...
@@ -44,8 +44,8 @@ export default {
},
});
},
searchPatientBy
Id
:
(
token
:
RecoilState
<
any
>
,
patientId
:
string
)
=>
{
return
client
.
get
(
`/doctor/patient/search/
${
patientId
}
`
,
{
searchPatientBy
Contact
:
(
token
:
RecoilState
<
any
>
,
contact
:
string
)
=>
{
return
client
.
get
(
`/doctor/patient/search/
${
contact
}
`
,
{
headers
:
{
Authorization
:
token
,
},
...
...
web/src/views/main/doctor/DoctorMenuContainer.tsx
View file @
16dd47c
...
...
@@ -48,7 +48,7 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
const [editPatientInfo, setEditPatientInfo] = useState<string>('');
const [newPatientRegisterModal, setNewPatientRegisterModal] = useState<boolean>(false);
const [newPatientSearch
Id, setNewPatientSearchId
] = useState<string>('');
const [newPatientSearch
Contact, setNewPatientSearchContact
] = useState<string>('');
const [newPatientSearchResult, setNewPatientSearchResult] = useState<any | null>(null);
const [prescribeModal, setPrescribeModal] = useState<boolean>(false);
...
...
@@ -56,7 +56,8 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
const [searchMedicineKeyword, setSearchMedicineKeyword] = useState<string>('');
const [medicineList, setMedicineList] = useState<any>([]);
const [prescribeMedicine, setPrescribeMedicine] = useState<any>(null);
const [dosage, setDosage] = useState<string>('1');
const [dailyDosage, setDailyDosage] = useState<string>('1');
const [totalDay, setTotalDay] = useState<string>('1');
const [qrcodeUrl, setQrcodeUrl] = useState<string | null>(null);
...
...
@@ -99,7 +100,7 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
await doctorApi.getPatientDetail(token, patientId).then(res => {
setPatientDetail(res.data);
const birth = res.data.profile.birth.split('
/
');
const birth = res.data.profile.birth.split('
-
');
setInfo({
infoType : 'PATIENT',
userNm : res.data.profile.userNm,
...
...
@@ -164,15 +165,15 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
};
const onSetNewPatientSearch
Id
= (e : React.ChangeEvent<HTMLInputElement>) => {
setNewPatientSearch
Id
(e.target.value);
const onSetNewPatientSearch
Contact
= (e : React.ChangeEvent<HTMLInputElement>) => {
setNewPatientSearch
Contact
(e.target.value);
};
const onSearchNewPatientBy
Email
= async () => {
const onSearchNewPatientBy
Contact
= async () => {
try {
setLoading(true);
await doctorApi.searchPatientBy
Id(token, newPatientSearchId
).then(res => {
setNewPatientSearchResult(res.data);
await doctorApi.searchPatientBy
Contact(token, newPatientSearchContact
).then(res => {
setNewPatientSearchResult(res.data
.patientInfo
);
setLoading(false);
}).catch(err => {
console.log(err);
...
...
@@ -188,11 +189,11 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
const onRegisterNewPatient = () => {
if(newPatientSearchResult) {
const {
patientId, patient
Nm } = newPatientSearchResult;
const {
userId, user
Nm } = newPatientSearchResult;
const onRegisterReq = async () => {
try {
const result = await doctorApi.registerPatient(token, {
patientId,
patientId
: userId
,
});
if(result.statusText === 'OK') {
Alert.onSuccess('환자에게 담당의 등록 요청을 전송했습니다.', () => null);
...
...
@@ -204,7 +205,7 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
}
};
Alert.onCheck(`${
patient
Nm} 환자에게 담당의 등록 요청을 전송하시겠습니까?`, onRegisterReq, () => null);
Alert.onCheck(`${
user
Nm} 환자에게 담당의 등록 요청을 전송하시겠습니까?`, onRegisterReq, () => null);
} else {
Alert.onError('환자를 먼저 검색해주세요.', () => null);
}
...
...
@@ -212,7 +213,7 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
const onCloseModal = async () => {
setNewPatientRegisterModal(false);
setNewPatientSearch
Id
('');
setNewPatientSearch
Contact
('');
setNewPatientSearchResult(null);
setEditModal(false);
setEditPatientInfo('');
...
...
@@ -221,7 +222,8 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
setSearchMedicineKeyword('');
setMedicineList([]);
setPrescribeMedicine(null);
setDosage('1');
setDailyDosage('1');
setTotalDay('1');
};
const onGoBottleDetail = (bottleId : number) => {
...
...
@@ -247,8 +249,12 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
}
};
const onSetDosage = (e : React.ChangeEvent<HTMLInputElement>) => {
setDosage(e.target.value);
const onSetDailyDosage = (e : React.ChangeEvent<HTMLInputElement>) => {
setDailyDosage(e.target.value);
};
const onSetTotalDay = (e : React.ChangeEvent<HTMLInputElement>) => {
setTotalDay(e.target.value);
};
const onSetNextStepPrescribe = () => {
...
...
@@ -267,12 +273,14 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
const res = await doctorApi.prescribeMedicine(token, {
patientId : patientDetail.profile.userId,
medicineId : prescribeMedicine.medicineId,
dosage,
dailyDosage,
totalDosage : String(parseInt(totalDay) * parseInt(dailyDosage)),
});
if(res.statusText === 'OK') {
setQrcodeUrl(res.data.qrCode);
setLoading(false);
Alert.onSuccess('처방 정보가 생성 되었습니다.', () => onSetNextStepPrescribe());
}
} catch(e : any) {
setLoading(false);
...
...
@@ -280,9 +288,8 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
}
};
Alert.onCheck(`${prescribeMedicine.name}(일 복용량:${d
osage})\n을
처방하시겠습니까?`, async () => {
Alert.onCheck(`${prescribeMedicine.name}(일 복용량:${d
ailyDosage})\n을 ${totalDay}일동안
처방하시겠습니까?`, async () => {
await onPrescribeMedicine();
Alert.onSuccess('처방 정보가 생성 되었습니다.', () => onSetNextStepPrescribe());
}, () => null);
};
...
...
@@ -342,9 +349,9 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
newPatientRegisterModal = {newPatientRegisterModal}
setNewPatientRegisterModal = {setNewPatientRegisterModal}
newPatientSearch
Id = {newPatientSearchId
}
onSetNewPatientSearch
Id = {onSetNewPatientSearchId
}
onSearchNewPatientBy
Email = {onSearchNewPatientByEmail
}
newPatientSearch
Contact = {newPatientSearchContact
}
onSetNewPatientSearch
Contact = {onSetNewPatientSearchContact
}
onSearchNewPatientBy
Contact = {onSearchNewPatientByContact
}
onRegisterNewPatient = {onRegisterNewPatient}
onCloseModal = {onCloseModal}
...
...
@@ -358,8 +365,10 @@ const DoctorMenuContainer = (props : DoctorMenuProps) => {
medicineList = {medicineList}
searchMedicine = {searchMedicine}
prescribeMedicine = {prescribeMedicine}
dosage = {dosage}
onSetDosage = {onSetDosage}
dailyDosage = {dailyDosage}
onSetDailyDosage = {onSetDailyDosage}
totalDay = {totalDay}
onSetTotalDay = {onSetTotalDay}
qrcodeUrl = {qrcodeUrl}
setPrescribeMedicine = {setPrescribeMedicine}
onPrescribeSubmit = {onPrescribeSubmit}
...
...
web/src/views/main/doctor/DoctorMenuPresenter.tsx
View file @
16dd47c
...
...
@@ -39,9 +39,9 @@ interface DoctorMenuProps {
newPatientRegisterModal : boolean;
setNewPatientRegisterModal : any;
newPatientSearch
Id
: string;
onSetNewPatientSearch
Id
: React.ChangeEventHandler<HTMLInputElement>;
onSearchNewPatientBy
Email
: () => void;
newPatientSearch
Contact
: string;
onSetNewPatientSearch
Contact
: React.ChangeEventHandler<HTMLInputElement>;
onSearchNewPatientBy
Contact
: () => void;
onRegisterNewPatient : () => void;
onCloseModal : () => void;
...
...
@@ -62,8 +62,10 @@ interface DoctorMenuProps {
prescribeMedicine : any;
setPrescribeMedicine : (arg0 : any) => void;
dosage : string;
onSetDosage : React.ChangeEventHandler<HTMLInputElement>;
dailyDosage : string;
onSetDailyDosage : React.ChangeEventHandler<HTMLInputElement>;
totalDay : string;
onSetTotalDay : React.ChangeEventHandler<HTMLInputElement>;
qrcodeUrl : string | null;
...
...
@@ -82,12 +84,12 @@ const DoctorMenuPresenter = (props : DoctorMenuProps) => {
<styled.NewPatientRegisterTitle>새 환자 등록</styled.NewPatientRegisterTitle>
<styled.NewPatientSearchWrapper>
<styled.NewPatientSearchInput
placeholder = '환자
이메일을
입력하세요.'
value = {props.newPatientSearch
Id
}
onChange = {props.onSetNewPatientSearch
Id
}
placeholder = '환자
의 연락처를
입력하세요.'
value = {props.newPatientSearch
Contact
}
onChange = {props.onSetNewPatientSearch
Contact
}
/>
<styled.NewPatientSearchButton
onClick = {props.onSearchNewPatientBy
Email
}
onClick = {props.onSearchNewPatientBy
Contact
}
>
<styled.NewPatientSearchButtonImg src = {lensImg}/>
</styled.NewPatientSearchButton>
...
...
@@ -97,10 +99,18 @@ const DoctorMenuPresenter = (props : DoctorMenuProps) => {
props.newPatientSearchResult ?
<styled.NewPatientSearchResult>
<styled.NewPatientSearchResultInfoWrapper>
<styled.NewPatientSearchResultInfo>이름 : </styled.NewPatientSearchResultInfo>
<styled.NewPatientSearchResultInfo>
이름 :
<styled.NewPatientSearchResultInfoText>
{props.newPatientSearchResult.patient
Nm}
{props.newPatientSearchResult.user
Nm}
</styled.NewPatientSearchResultInfoText>
</styled.NewPatientSearchResultInfo>
<styled.NewPatientSearchResultInfo>
생년월일 :
<styled.NewPatientSearchResultInfoText>
{props.newPatientSearchResult.birth}
</styled.NewPatientSearchResultInfoText>
</styled.NewPatientSearchResultInfo>
</styled.NewPatientSearchResultInfoWrapper>
</styled.NewPatientSearchResult> :
'🤔검색 결과가 없습니다.'
...
...
@@ -229,8 +239,17 @@ const DoctorMenuPresenter = (props : DoctorMenuProps) => {
*하루 복용량을 입력하세요.
</styled.MedicineDosageInfo>
<styled.MedicineDosageInput
value = {props.dosage}
onChange = {props.onSetDosage}
value = {props.dailyDosage}
onChange = {props.onSetDailyDosage}
min = {1}
max = {3}
/>
<styled.MedicineDosageInfo>
*총 며칠 분량인지 입력하세요.
</styled.MedicineDosageInfo>
<styled.MedicineDosageInput
value = {props.totalDay}
onChange = {props.onSetTotalDay}
/>
</styled.MedicineDosageSetWrapper>
:
...
...
web/src/views/main/doctor/DoctorMenuStyled.tsx
View file @
16dd47c
...
...
@@ -89,14 +89,18 @@ export const NewPatientSearchResult = styled.div `
export const NewPatientSearchResultInfoWrapper = styled.div `
display : flex;
flex-direction : column;
`;
export const NewPatientSearchResultInfo = styled.div `
display : flex;
flex-direction : row;
font-size : 13px;
font-weight : 600;
color : #a0a0a0;
margin : 0 5px 0
0
;
margin : 0 5px 0
5px
;
`;
export const NewPatientSearchResultInfoText = styled.div `
...
...
@@ -104,6 +108,8 @@ export const NewPatientSearchResultInfoText = styled.div `
color : #343434;
font-weight : 600;
letter-spacing : 1px;
margin : 0 0 0 5px;
`;
export const NewPatientRegisterButtonWrapper = styled.div `
...
...
@@ -413,7 +419,7 @@ export const MedicineDosageInfo = styled.div `
color : #a0a0a0;
width : 100%;
margin :
0 0 2
0px 0;
margin :
10px 0 1
0px 0;
border : none;
background-color : transparent;
...
...
@@ -423,9 +429,8 @@ export const MedicineDosageInfo = styled.div `
export const MedicineDosageInput = styled.input.attrs({
type : 'number',
min : '1',
max : '3',
}) `
margin : 0 0 10px 0;
width : 40%;
padding : 10px 20px;
...
...
Please
register
or
login
to post a comment