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-05-24 16:14:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c343e776d438d73a12ef5f7369fad47ed319dc0b
c343e776
1 parent
f9bb7d3b
db. unnecessary tag remove
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
server/src/lib/UpdatingMedicineInfo.js
server/src/lib/UpdatingMedicineInfo.js
View file @
c343e77
...
...
@@ -39,15 +39,17 @@ const getItemsList = async(queryUrl) => {
//itemArray에 있는 모든 data를 MongoDB의 SMB collections에 저장함
const
exportJsonData
=
(
itemList
)
=>
{
itemList
.
forEach
(
item
=>
{
itemList
.
forEach
(
async
item
=>
{
const
medicineId
=
item
.
itemSeq
;
const
medicineInfo
=
{
name
:
item
.
itemName
,
company
:
item
.
entpName
,
target
:
item
.
efcyQesitm
,
dosage
:
item
.
useMethodQesitm
,
warn
:
item
.
atpnWarnQesitm
+
'\n\n'
+
item
.
atpnQesitm
,
antiEffect
:
item
.
seQesitm
target
:
await
slicingInfo
(
item
.
efcyQesitm
),
dosage
:
await
slicingInfo
(
item
.
useMethodQesitm
),
warn
:
await
slicingInfo
(
item
.
atpnWarnQesitm
?
item
.
atpnWarnQesitm
+
'\n'
+
item
.
atpnQesitm
:
item
.
atpnQesitm
),
antiEffect
:
await
slicingInfo
(
item
.
seQesitm
)
};
Medicine
.
findOneAndUpdate
({
...
...
@@ -56,4 +58,19 @@ const exportJsonData = (itemList) => {
upsert
:
true
}).
exec
();
})
}
//복용 정보에서 불필요한 태그를 제거하고 제거된 값을 반환한다.
const
slicingInfo
=
async
(
info
)
=>
{
let
result
=
info
;
if
(
info
)
{
result
=
await
info
.
split
(
'<p>'
).
join
(
''
)
.
split
(
'</p>'
).
join
(
''
)
.
split
(
'<sup>'
).
join
(
''
)
.
split
(
'</sup>'
).
join
(
''
)
.
split
(
'null'
).
join
(
''
);
}
return
result
;
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment