{"action":"created","comment":{"url":"https://api.github.com/repos/projectbuendia/buendia/pulls/comments/50845838","id":50845838,"diff_hunk":"@@ -159,86 +214,25 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t\n                         // observation is a concept, then the three columns contain the English\n                         // name, the OpenMRS ID, and the UUID of the concept; otherwise all\n                         // three columns contain the formatted value.\n-                        final int valueColumn = FIXED_HEADERS.length + index*COLUMNS_PER_OBS;\n-                        VisitObsValue.visit(obs, new VisitObsValue.ObsValueVisitor<Void>() {\n-                            @Override public Void visitCoded(Concept value) {\n-                                if (value == null || value.getUuid() == null || value.getUuid()\n-                                    .isEmpty()) {\n-                                    values[valueColumn] = \"\";\n-                                    values[valueColumn + 1] = \"\";\n-                                    values[valueColumn + 2] = \"\";\n-                                } else {\n-                                    values[valueColumn] = NAMER.getClientName(value);\n-                                    values[valueColumn + 1] = value.getId();\n-                                    values[valueColumn + 2] = value.getUuid();\n-                                }\n-                                return null;\n-                            }\n-\n-                            @Override public Void visitNumeric(Double value) {\n-                                String s;\n-                                if (value == null) {\n-                                    s = \"\";\n-                                } else {\n-                                    s = Double.toString(value);\n-                                }\n-                                values[valueColumn] = s;\n-                                values[valueColumn + 1] = s;\n-                                values[valueColumn + 2] = s;\n-                                return null;\n-                            }\n-\n-                            @Override public Void visitBoolean(Boolean value) {\n-                                String s;\n-                                if (value == null) {\n-                                    s = \"\";\n-                                } else {\n-                                    s = Boolean.toString(value);\n-                                }\n-                                values[valueColumn] = s;\n-                                values[valueColumn + 1] = s;\n-                                values[valueColumn + 2] = s;\n-                                return null;\n-                            }\n-\n-                            @Override public Void visitText(String value) {\n-                                if (value == null) {\n-                                    value = \"\";\n-                                }\n-                                values[valueColumn] = value;\n-                                values[valueColumn + 1] = value;\n-                                values[valueColumn + 2] = value;\n-                                return null;\n-                            }\n-\n-                            @Override public Void visitDate(Date d) {\n-                                String value;\n-                                if (d == null) {\n-                                    value = \"\";\n-                                } else {\n-                                    value = Utils.YYYYMMDD_UTC_FORMAT.format(d);\n-                                }\n-                                values[valueColumn] = value;\n-                                values[valueColumn + 1] = value;\n-                                values[valueColumn + 2] = value;\n-                                return null;\n-                            }\n+                        int valueColumn = FIXED_HEADERS.length + index*COLUMNS_PER_OBS;\n \n-                            @Override public Void visitDateTime(Date d) {\n-                                String value;\n-                                if (d == null) {\n-                                    value = \"\";\n-                                } else {\n-                                    value = Utils.SPREADSHEET_FORMAT.format(d);\n-                                }\n+                        if (obs.getValueCoded() != null){\n+                            Concept value = obs.getValueCoded();\n+                            values[valueColumn] = NAMER.getClientName(value);\n+                            values[valueColumn + 1] = value.getId();\n+                            values[valueColumn + 2] = value.getUuid();\n+                        } else {\n+                            String value = (String) VisitObsValue.visit(obs, stringVisitor);\n+                            if ((value != null) && (!value.isEmpty())) {\n                                 values[valueColumn] = value;\n                                 values[valueColumn + 1] = value;\n                                 values[valueColumn + 2] = value;\n-                                return null;\n                             }\n-                        });\n+                        }\n+                    }\n+                    if (i == (encounters.size() - 1)){","path":"openmrs/omod/src/main/java/org/openmrs/projectbuendia/servlet/DataExportServlet.java","position":205,"original_position":205,"commit_id":"a4743db436929541073b093cb99faa4d33b46767","original_commit_id":"a4743db436929541073b093cb99faa4d33b46767","user":{"login":"llvasconcellos","id":1710823,"avatar_url":"https://avatars.githubusercontent.com/u/1710823?v=3","gravatar_id":"","url":"https://api.github.com/users/llvasconcellos","html_url":"https://github.com/llvasconcellos","followers_url":"https://api.github.com/users/llvasconcellos/followers","following_url":"https://api.github.com/users/llvasconcellos/following{/other_user}","gists_url":"https://api.github.com/users/llvasconcellos/gists{/gist_id}","starred_url":"https://api.github.com/users/llvasconcellos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llvasconcellos/subscriptions","organizations_url":"https://api.github.com/users/llvasconcellos/orgs","repos_url":"https://api.github.com/users/llvasconcellos/repos","events_url":"https://api.github.com/users/llvasconcellos/events{/privacy}","received_events_url":"https://api.github.com/users/llvasconcellos/received_events","type":"User","site_admin":false},"body":"F...k you are right. \r\nhttps://www.youtube.com/watch?v=5rAOyh7YmEc","created_at":"2016-01-26T15:06:22Z","updated_at":"2016-01-26T15:06:22Z","html_url":"https://github.com/projectbuendia/buendia/pull/74#discussion_r50845838","pull_request_url":"https://api.github.com/repos/projectbuendia/buendia/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/comments/50845838"},"html":{"href":"https://github.com/projectbuendia/buendia/pull/74#discussion_r50845838"},"pull_request":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/projectbuendia/buendia/pulls/74","id":57179147,"html_url":"https://github.com/projectbuendia/buendia/pull/74","diff_url":"https://github.com/projectbuendia/buendia/pull/74.diff","patch_url":"https://github.com/projectbuendia/buendia/pull/74.patch","issue_url":"https://api.github.com/repos/projectbuendia/buendia/issues/74","number":74,"state":"open","locked":false,"title":"New CSV Export","user":{"login":"llvasconcellos","id":1710823,"avatar_url":"https://avatars.githubusercontent.com/u/1710823?v=3","gravatar_id":"","url":"https://api.github.com/users/llvasconcellos","html_url":"https://github.com/llvasconcellos","followers_url":"https://api.github.com/users/llvasconcellos/followers","following_url":"https://api.github.com/users/llvasconcellos/following{/other_user}","gists_url":"https://api.github.com/users/llvasconcellos/gists{/gist_id}","starred_url":"https://api.github.com/users/llvasconcellos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llvasconcellos/subscriptions","organizations_url":"https://api.github.com/users/llvasconcellos/orgs","repos_url":"https://api.github.com/users/llvasconcellos/repos","events_url":"https://api.github.com/users/llvasconcellos/events{/privacy}","received_events_url":"https://api.github.com/users/llvasconcellos/received_events","type":"User","site_admin":false},"body":"The default behavior of the new CSV Export is to merge encounters that are near each other by 30 minutes.\r\nEach encounter within 30 minutes will be merged to the previous one overlapping the old value with the most recent one.\r\nThe interval can be customized passing a value in the url like:\r\nhttp://localhost:9000/openmrs/moduleServlet/buendiadata?interval=120\r\n","created_at":"2016-01-26T07:55:25Z","updated_at":"2016-01-26T15:06:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f33285ded7d6c0ae186ba1fc385040e087532a85","assignee":{"login":"llvasconcellos","id":1710823,"avatar_url":"https://avatars.githubusercontent.com/u/1710823?v=3","gravatar_id":"","url":"https://api.github.com/users/llvasconcellos","html_url":"https://github.com/llvasconcellos","followers_url":"https://api.github.com/users/llvasconcellos/followers","following_url":"https://api.github.com/users/llvasconcellos/following{/other_user}","gists_url":"https://api.github.com/users/llvasconcellos/gists{/gist_id}","starred_url":"https://api.github.com/users/llvasconcellos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llvasconcellos/subscriptions","organizations_url":"https://api.github.com/users/llvasconcellos/orgs","repos_url":"https://api.github.com/users/llvasconcellos/repos","events_url":"https://api.github.com/users/llvasconcellos/events{/privacy}","received_events_url":"https://api.github.com/users/llvasconcellos/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/projectbuendia/buendia/pulls/74/commits","review_comments_url":"https://api.github.com/repos/projectbuendia/buendia/pulls/74/comments","review_comment_url":"https://api.github.com/repos/projectbuendia/buendia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectbuendia/buendia/issues/74/comments","statuses_url":"https://api.github.com/repos/projectbuendia/buendia/statuses/a4743db436929541073b093cb99faa4d33b46767","head":{"label":"projectbuendia:feature/llvasconcellos-new-csv-export","ref":"feature/llvasconcellos-new-csv-export","sha":"a4743db436929541073b093cb99faa4d33b46767","user":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"repo":{"id":30520538,"name":"buendia","full_name":"projectbuendia/buendia","owner":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectbuendia/buendia","description":"Main project repository (see the Wiki for details)","fork":false,"url":"https://api.github.com/repos/projectbuendia/buendia","forks_url":"https://api.github.com/repos/projectbuendia/buendia/forks","keys_url":"https://api.github.com/repos/projectbuendia/buendia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectbuendia/buendia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectbuendia/buendia/teams","hooks_url":"https://api.github.com/repos/projectbuendia/buendia/hooks","issue_events_url":"https://api.github.com/repos/projectbuendia/buendia/issues/events{/number}","events_url":"https://api.github.com/repos/projectbuendia/buendia/events","assignees_url":"https://api.github.com/repos/projectbuendia/buendia/assignees{/user}","branches_url":"https://api.github.com/repos/projectbuendia/buendia/branches{/branch}","tags_url":"https://api.github.com/repos/projectbuendia/buendia/tags","blobs_url":"https://api.github.com/repos/projectbuendia/buendia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectbuendia/buendia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectbuendia/buendia/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectbuendia/buendia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectbuendia/buendia/statuses/{sha}","languages_url":"https://api.github.com/repos/projectbuendia/buendia/languages","stargazers_url":"https://api.github.com/repos/projectbuendia/buendia/stargazers","contributors_url":"https://api.github.com/repos/projectbuendia/buendia/contributors","subscribers_url":"https://api.github.com/repos/projectbuendia/buendia/subscribers","subscription_url":"https://api.github.com/repos/projectbuendia/buendia/subscription","commits_url":"https://api.github.com/repos/projectbuendia/buendia/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectbuendia/buendia/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectbuendia/buendia/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectbuendia/buendia/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectbuendia/buendia/contents/{+path}","compare_url":"https://api.github.com/repos/projectbuendia/buendia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectbuendia/buendia/merges","archive_url":"https://api.github.com/repos/projectbuendia/buendia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectbuendia/buendia/downloads","issues_url":"https://api.github.com/repos/projectbuendia/buendia/issues{/number}","pulls_url":"https://api.github.com/repos/projectbuendia/buendia/pulls{/number}","milestones_url":"https://api.github.com/repos/projectbuendia/buendia/milestones{/number}","notifications_url":"https://api.github.com/repos/projectbuendia/buendia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectbuendia/buendia/labels{/name}","releases_url":"https://api.github.com/repos/projectbuendia/buendia/releases{/id}","deployments_url":"https://api.github.com/repos/projectbuendia/buendia/deployments","created_at":"2015-02-09T05:38:57Z","updated_at":"2016-01-21T11:35:23Z","pushed_at":"2016-01-26T13:31:07Z","git_url":"git://github.com/projectbuendia/buendia.git","ssh_url":"git@github.com:projectbuendia/buendia.git","clone_url":"https://github.com/projectbuendia/buendia.git","svn_url":"https://github.com/projectbuendia/buendia","homepage":"","size":7607,"stargazers_count":105,"watchers_count":105,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":9,"forks":44,"open_issues":9,"watchers":105,"default_branch":"dev"}},"base":{"label":"projectbuendia:dev","ref":"dev","sha":"d6812bc5336ca3a27f8fc599f68ade4ad598ca97","user":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"repo":{"id":30520538,"name":"buendia","full_name":"projectbuendia/buendia","owner":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectbuendia/buendia","description":"Main project repository (see the Wiki for details)","fork":false,"url":"https://api.github.com/repos/projectbuendia/buendia","forks_url":"https://api.github.com/repos/projectbuendia/buendia/forks","keys_url":"https://api.github.com/repos/projectbuendia/buendia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectbuendia/buendia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectbuendia/buendia/teams","hooks_url":"https://api.github.com/repos/projectbuendia/buendia/hooks","issue_events_url":"https://api.github.com/repos/projectbuendia/buendia/issues/events{/number}","events_url":"https://api.github.com/repos/projectbuendia/buendia/events","assignees_url":"https://api.github.com/repos/projectbuendia/buendia/assignees{/user}","branches_url":"https://api.github.com/repos/projectbuendia/buendia/branches{/branch}","tags_url":"https://api.github.com/repos/projectbuendia/buendia/tags","blobs_url":"https://api.github.com/repos/projectbuendia/buendia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectbuendia/buendia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectbuendia/buendia/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectbuendia/buendia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectbuendia/buendia/statuses/{sha}","languages_url":"https://api.github.com/repos/projectbuendia/buendia/languages","stargazers_url":"https://api.github.com/repos/projectbuendia/buendia/stargazers","contributors_url":"https://api.github.com/repos/projectbuendia/buendia/contributors","subscribers_url":"https://api.github.com/repos/projectbuendia/buendia/subscribers","subscription_url":"https://api.github.com/repos/projectbuendia/buendia/subscription","commits_url":"https://api.github.com/repos/projectbuendia/buendia/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectbuendia/buendia/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectbuendia/buendia/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectbuendia/buendia/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectbuendia/buendia/contents/{+path}","compare_url":"https://api.github.com/repos/projectbuendia/buendia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectbuendia/buendia/merges","archive_url":"https://api.github.com/repos/projectbuendia/buendia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectbuendia/buendia/downloads","issues_url":"https://api.github.com/repos/projectbuendia/buendia/issues{/number}","pulls_url":"https://api.github.com/repos/projectbuendia/buendia/pulls{/number}","milestones_url":"https://api.github.com/repos/projectbuendia/buendia/milestones{/number}","notifications_url":"https://api.github.com/repos/projectbuendia/buendia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectbuendia/buendia/labels{/name}","releases_url":"https://api.github.com/repos/projectbuendia/buendia/releases{/id}","deployments_url":"https://api.github.com/repos/projectbuendia/buendia/deployments","created_at":"2015-02-09T05:38:57Z","updated_at":"2016-01-21T11:35:23Z","pushed_at":"2016-01-26T13:31:07Z","git_url":"git://github.com/projectbuendia/buendia.git","ssh_url":"git@github.com:projectbuendia/buendia.git","clone_url":"https://github.com/projectbuendia/buendia.git","svn_url":"https://github.com/projectbuendia/buendia","homepage":"","size":7607,"stargazers_count":105,"watchers_count":105,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":9,"forks":44,"open_issues":9,"watchers":105,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/74"},"html":{"href":"https://github.com/projectbuendia/buendia/pull/74"},"issue":{"href":"https://api.github.com/repos/projectbuendia/buendia/issues/74"},"comments":{"href":"https://api.github.com/repos/projectbuendia/buendia/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectbuendia/buendia/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/projectbuendia/buendia/statuses/a4743db436929541073b093cb99faa4d33b46767"}}}}