Created
March 26, 2020 05:15
-
-
Save keigoi/8cfc6b4e752ac6e3e55cb607fe6e1bf1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD CSV WITH HEADERS FROM "https://docs.google.com/spreadsheets/u/0/d/1goCfip58Sq7Th_jVwc-wSAvlINxW2XHsxfh16SGHSro/export?format=csv&id=1goCfip58Sq7Th_jVwc-wSAvlINxW2XHsxfh16SGHSro&gid=0" AS line | |
FIELDTERMINATOR ',' | |
CREATE (p:Patient { | |
id:line.id, age:line.age, sex:line.sex, area:line.area, | |
confirm_date:line.confirm_date, note:line.note | |
}) | |
WITH line | |
MATCH (p:Patient {id:line.id}) MATCH (p0:Patient {id:line.source_id} ) | |
WHERE line.source_id IS NOT NULL | |
CREATE (p) -[:FROM{link_kind:line.link_kind}]-> (p0); | |
MATCH (p:Patient) | |
SET p.caption = reduce(str="", s IN ["("+p.id+")", p.age+"代", p.sex, p.confirm_date+"診断", p.area] | str + "\n" + COALESCE(s, "")); | |
MATCH (p:Patient) -[f:FROM{link_kind:'ジム'}]-> (p0:Patient) | |
DELETE f CREATE (p) -[:GYM]-> (p0); | |
MATCH (p:Patient) -[f:FROM{link_kind:'家族'}]-> (p0:Patient) | |
DELETE f CREATE (p) -[:HOUSEHOLD]-> (p0); | |
MATCH (p:Patient) -[f:FROM{link_kind:'職場'}]-> (p0:Patient) | |
DELETE f CREATE (p) -[:WORK]-> (p0); | |
MATCH (p:Patient) -[f:FROM{link_kind:'知人'}]-> (p0:Patient) | |
DELETE f CREATE (p) -[:ACQUAINT]-> (p0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment