health-data-standards 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -4,12 +4,14 @@ require 'mongoid'
4
4
  require 'uuid'
5
5
  require 'quality-measure-engine'
6
6
  require 'builder'
7
+ require 'csv'
7
8
 
8
9
  require_relative 'health-data-standards/export/template_helper'
9
10
  require_relative 'health-data-standards/export/view_helper'
10
11
  require_relative 'health-data-standards/export/rendering_context'
11
12
  require_relative 'health-data-standards/export/c32'
12
13
  require_relative 'health-data-standards/export/ccr'
14
+ require_relative 'health-data-standards/export/csv'
13
15
 
14
16
  require_relative 'health-data-standards/models/entry'
15
17
  require_relative 'health-data-standards/models/record'
@@ -0,0 +1,27 @@
1
+ module HealthDataStandards
2
+ module Export
3
+ module CommaSV
4
+ # Builds a CSV row representing the patient.
5
+ #
6
+ # @return csv representation of patient data
7
+ def export(patient,header)
8
+
9
+
10
+ csv = header ? [generate_header,extract_patient_data(patient)] : extract_patient_data(patient)
11
+
12
+
13
+ end
14
+
15
+ def generate_header
16
+ ["patient_id", "first name", "last name", "gender","race","ethnicity","birthdate"]
17
+ end
18
+
19
+ def extract_patient_data(patient)
20
+ [patient.patient_id, patient.first, patient.last, patient.gender,patient.race,patient.ethnicity,Time.at(patient.birthdate).strftime('%m/%d/%Y')]
21
+ end
22
+
23
+ extend self
24
+
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: health-data-standards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-22 00:00:00.000000000Z
12
+ date: 2011-12-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erubis
16
- requirement: &70300042790880 !ruby/object:Gem::Requirement
16
+ requirement: &2166084900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.6'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70300042790880
24
+ version_requirements: *2166084900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mongoid
27
- requirement: &70300042789820 !ruby/object:Gem::Requirement
27
+ requirement: &2166083200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.3.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70300042789820
35
+ version_requirements: *2166083200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: uuid
38
- requirement: &70300042787740 !ruby/object:Gem::Requirement
38
+ requirement: &2166081180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.3.4
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70300042787740
46
+ version_requirements: *2166081180
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: quality-measure-engine
49
- requirement: &70300042786680 !ruby/object:Gem::Requirement
49
+ requirement: &2166080160 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70300042786680
57
+ version_requirements: *2166080160
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: builder
60
- requirement: &70300042785780 !ruby/object:Gem::Requirement
60
+ requirement: &2166078960 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 3.0.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70300042785780
68
+ version_requirements: *2166078960
69
69
  description: A library for generating and consuming various healthcare related formats.
70
70
  This includes HITSP C32, ASTM CCR and PQRI.
71
71
  email: talk@projectpophealth.org
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - lib/health-data-standards/export/c32.rb
77
77
  - lib/health-data-standards/export/ccr.rb
78
+ - lib/health-data-standards/export/csv.rb
78
79
  - lib/health-data-standards/export/rendering_context.rb
79
80
  - lib/health-data-standards/export/template_helper.rb
80
81
  - lib/health-data-standards/export/view_helper.rb