-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #312 from bmeg/feature/pivot
Pivot Operation
- Loading branch information
Showing
16 changed files
with
990 additions
and
735 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{"from":"patient_a", "to":"observation_a1", "label":"patient_observation"} | ||
{"from":"patient_a", "to":"observation_a2", "label":"patient_observation"} | ||
{"from":"patient_a", "to":"observation_a3", "label":"patient_observation"} | ||
{"from":"patient_b", "to":"observation_b1", "label":"patient_observation"} | ||
{"from":"patient_b", "to":"observation_b2", "label":"patient_observation"} | ||
{"from":"patient_b", "to":"observation_b3", "label":"patient_observation"} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{"gid":"patient_a", "label":"Patient", "data":{"name":"Alice"}} | ||
{"gid":"patient_b", "label":"Patient", "data":{"name":"Bob"}} | ||
{"gid":"observation_a1", "label":"Observation", "data":{"key":"age", "value":36}} | ||
{"gid":"observation_a2", "label":"Observation", "data":{"key":"sex", "value":"Female"}} | ||
{"gid":"observation_a3", "label":"Observation", "data":{"key":"blood_pressure", "value":"111/78"}} | ||
{"gid":"observation_b1", "label":"Observation", "data":{"key":"age", "value":42}} | ||
{"gid":"observation_b2", "label":"Observation", "data":{"key":"sex", "value":"Male"}} | ||
{"gid":"observation_b3", "label":"Observation", "data":{"key":"blood_pressure", "value":"120/80"}} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from __future__ import absolute_import | ||
|
||
import gripql | ||
|
||
|
||
def test_pivot(man): | ||
errors = [] | ||
G = man.setGraph("fhir") | ||
|
||
for row in G.query().V().hasLabel("Patient").as_("a").out("patient_observation").pivot("$a._gid", "$.key", "$.value" ): | ||
print(row) | ||
|
||
return errors | ||
|
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
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
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
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
Oops, something went wrong.