{"action":"created","comment":{"url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/comments/175085429","pull_request_review_id":104560102,"id":175085429,"diff_hunk":"@@ -40,22 +38,19 @@ public Patient findByNationalFpId(String nationalSubjectId) {\n     }\n \n     private Patient findByIdType(String subjectId, String idTypeProp) {\n+        Patient patient = null;\n         if (properties.isGlobalPropertySet(idTypeProp)) {\n             String identifierUuid = properties.getGlobalProperty(idTypeProp);\n-            PatientIdentifierType idType = patientService.getPatientIdentifierTypeByUuid(identifierUuid);\n-            if (idType == null) {\n-                LOGGER.warn(\"Identifier type defined by prop {} is missing: {}\", idTypeProp, identifierUuid);\n+            if (isPatientIdentifierTypeExists(identifierUuid)) {\n+                patient = registrationCoreService.findByPatientIdentifier(subjectId, identifierUuid);\n             } else {\n-                //Currently method getPatients() doesn't take into consideration the identifierTypes,\n-                //so it needs to be filtered anyway\n-                List<Patient> patients = patientService.getPatients(null, subjectId,\n-                        Collections.singletonList(idType), true).stream()\n-                        .filter(p -> p.getIdentifiers().stream().anyMatch(pi -> pi.getIdentifierType().equals(idType)))\n-                        .collect(Collectors.toList());\n-\n-                return CollectionUtils.isEmpty(patients) ? null : patients.get(0);\n+                LOGGER.warn(\"Identifier type defined by prop {} is missing: {}\", idTypeProp, identifierUuid);\n             }\n         }\n-        return null;\n+        return patient;\n+    }\n+\n+    private boolean isPatientIdentifierTypeExists(String patientIdentifierTypeUuid) {","path":"api/src/main/java/org/openmrs/module/m2sysbiometrics/util/impl/PatientHelperImpl.java","position":59,"original_position":59,"commit_id":"dc91d572992d628189854d1baf2ee5d6deedd56a","original_commit_id":"dc91d572992d628189854d1baf2ee5d6deedd56a","user":{"login":"pgesek","id":1384169,"avatar_url":"https://avatars2.githubusercontent.com/u/1384169?v=4","gravatar_id":"","url":"https://api.github.com/users/pgesek","html_url":"https://github.com/pgesek","followers_url":"https://api.github.com/users/pgesek/followers","following_url":"https://api.github.com/users/pgesek/following{/other_user}","gists_url":"https://api.github.com/users/pgesek/gists{/gist_id}","starred_url":"https://api.github.com/users/pgesek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgesek/subscriptions","organizations_url":"https://api.github.com/users/pgesek/orgs","repos_url":"https://api.github.com/users/pgesek/repos","events_url":"https://api.github.com/users/pgesek/events{/privacy}","received_events_url":"https://api.github.com/users/pgesek/received_events","type":"User","site_admin":false},"body":"drop the is part, you don't generally need it when using 'exists' in the name","created_at":"2018-03-16T13:16:46Z","updated_at":"2018-03-16T13:17:13Z","html_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics/pull/11#discussion_r175085429","pull_request_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/11","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/comments/175085429"},"html":{"href":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics/pull/11#discussion_r175085429"},"pull_request":{"href":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/11","id":174719697,"html_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics/pull/11","diff_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics/pull/11.diff","patch_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics/pull/11.patch","issue_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues/11","number":11,"state":"open","locked":false,"title":"ITNFA-19: Added EnrollmentResult and moved findByPatientIdentifier to RegistrationCore","user":{"login":"dserkowski","id":29867015,"avatar_url":"https://avatars0.githubusercontent.com/u/29867015?v=4","gravatar_id":"","url":"https://api.github.com/users/dserkowski","html_url":"https://github.com/dserkowski","followers_url":"https://api.github.com/users/dserkowski/followers","following_url":"https://api.github.com/users/dserkowski/following{/other_user}","gists_url":"https://api.github.com/users/dserkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/dserkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dserkowski/subscriptions","organizations_url":"https://api.github.com/users/dserkowski/orgs","repos_url":"https://api.github.com/users/dserkowski/repos","events_url":"https://api.github.com/users/dserkowski/events{/privacy}","received_events_url":"https://api.github.com/users/dserkowski/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-13T16:39:00Z","updated_at":"2018-03-16T13:17:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bbb7a724e97c9cf816999882b0eed442f56361ed","assignee":null,"assignees":[],"requested_reviewers":[{"login":"oskarhinc","id":19305104,"avatar_url":"https://avatars1.githubusercontent.com/u/19305104?v=4","gravatar_id":"","url":"https://api.github.com/users/oskarhinc","html_url":"https://github.com/oskarhinc","followers_url":"https://api.github.com/users/oskarhinc/followers","following_url":"https://api.github.com/users/oskarhinc/following{/other_user}","gists_url":"https://api.github.com/users/oskarhinc/gists{/gist_id}","starred_url":"https://api.github.com/users/oskarhinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oskarhinc/subscriptions","organizations_url":"https://api.github.com/users/oskarhinc/orgs","repos_url":"https://api.github.com/users/oskarhinc/repos","events_url":"https://api.github.com/users/oskarhinc/events{/privacy}","received_events_url":"https://api.github.com/users/oskarhinc/received_events","type":"User","site_admin":false},{"login":"pawelcieszko","id":29859787,"avatar_url":"https://avatars1.githubusercontent.com/u/29859787?v=4","gravatar_id":"","url":"https://api.github.com/users/pawelcieszko","html_url":"https://github.com/pawelcieszko","followers_url":"https://api.github.com/users/pawelcieszko/followers","following_url":"https://api.github.com/users/pawelcieszko/following{/other_user}","gists_url":"https://api.github.com/users/pawelcieszko/gists{/gist_id}","starred_url":"https://api.github.com/users/pawelcieszko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pawelcieszko/subscriptions","organizations_url":"https://api.github.com/users/pawelcieszko/orgs","repos_url":"https://api.github.com/users/pawelcieszko/repos","events_url":"https://api.github.com/users/pawelcieszko/events{/privacy}","received_events_url":"https://api.github.com/users/pawelcieszko/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/11/commits","review_comments_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/11/comments","review_comment_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues/11/comments","statuses_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/statuses/dc91d572992d628189854d1baf2ee5d6deedd56a","head":{"label":"IsantePlus:ITNFA-19","ref":"ITNFA-19","sha":"dc91d572992d628189854d1baf2ee5d6deedd56a","user":{"login":"IsantePlus","id":20406001,"avatar_url":"https://avatars2.githubusercontent.com/u/20406001?v=4","gravatar_id":"","url":"https://api.github.com/users/IsantePlus","html_url":"https://github.com/IsantePlus","followers_url":"https://api.github.com/users/IsantePlus/followers","following_url":"https://api.github.com/users/IsantePlus/following{/other_user}","gists_url":"https://api.github.com/users/IsantePlus/gists{/gist_id}","starred_url":"https://api.github.com/users/IsantePlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IsantePlus/subscriptions","organizations_url":"https://api.github.com/users/IsantePlus/orgs","repos_url":"https://api.github.com/users/IsantePlus/repos","events_url":"https://api.github.com/users/IsantePlus/events{/privacy}","received_events_url":"https://api.github.com/users/IsantePlus/received_events","type":"Organization","site_admin":false},"repo":{"id":98664465,"name":"openmrs-module-m2sys-biometrics","full_name":"IsantePlus/openmrs-module-m2sys-biometrics","owner":{"login":"IsantePlus","id":20406001,"avatar_url":"https://avatars2.githubusercontent.com/u/20406001?v=4","gravatar_id":"","url":"https://api.github.com/users/IsantePlus","html_url":"https://github.com/IsantePlus","followers_url":"https://api.github.com/users/IsantePlus/followers","following_url":"https://api.github.com/users/IsantePlus/following{/other_user}","gists_url":"https://api.github.com/users/IsantePlus/gists{/gist_id}","starred_url":"https://api.github.com/users/IsantePlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IsantePlus/subscriptions","organizations_url":"https://api.github.com/users/IsantePlus/orgs","repos_url":"https://api.github.com/users/IsantePlus/repos","events_url":"https://api.github.com/users/IsantePlus/events{/privacy}","received_events_url":"https://api.github.com/users/IsantePlus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics","description":"M2sys biometric server implementation.","fork":false,"url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics","forks_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/forks","keys_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/teams","hooks_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/hooks","issue_events_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues/events{/number}","events_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/events","assignees_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/assignees{/user}","branches_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/branches{/branch}","tags_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/tags","blobs_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/statuses/{sha}","languages_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/languages","stargazers_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/stargazers","contributors_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/contributors","subscribers_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/subscribers","subscription_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/subscription","commits_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/contents/{+path}","compare_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/merges","archive_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/downloads","issues_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues{/number}","pulls_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls{/number}","milestones_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/milestones{/number}","notifications_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/labels{/name}","releases_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/releases{/id}","deployments_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/deployments","created_at":"2017-07-28T15:46:43Z","updated_at":"2018-03-14T15:42:52Z","pushed_at":"2018-03-16T12:26:19Z","git_url":"git://github.com/IsantePlus/openmrs-module-m2sys-biometrics.git","ssh_url":"git@github.com:IsantePlus/openmrs-module-m2sys-biometrics.git","clone_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics.git","svn_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics","homepage":null,"size":424,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"IsantePlus:master","ref":"master","sha":"13532bc83e709e3709c71660fd6b76271395b597","user":{"login":"IsantePlus","id":20406001,"avatar_url":"https://avatars2.githubusercontent.com/u/20406001?v=4","gravatar_id":"","url":"https://api.github.com/users/IsantePlus","html_url":"https://github.com/IsantePlus","followers_url":"https://api.github.com/users/IsantePlus/followers","following_url":"https://api.github.com/users/IsantePlus/following{/other_user}","gists_url":"https://api.github.com/users/IsantePlus/gists{/gist_id}","starred_url":"https://api.github.com/users/IsantePlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IsantePlus/subscriptions","organizations_url":"https://api.github.com/users/IsantePlus/orgs","repos_url":"https://api.github.com/users/IsantePlus/repos","events_url":"https://api.github.com/users/IsantePlus/events{/privacy}","received_events_url":"https://api.github.com/users/IsantePlus/received_events","type":"Organization","site_admin":false},"repo":{"id":98664465,"name":"openmrs-module-m2sys-biometrics","full_name":"IsantePlus/openmrs-module-m2sys-biometrics","owner":{"login":"IsantePlus","id":20406001,"avatar_url":"https://avatars2.githubusercontent.com/u/20406001?v=4","gravatar_id":"","url":"https://api.github.com/users/IsantePlus","html_url":"https://github.com/IsantePlus","followers_url":"https://api.github.com/users/IsantePlus/followers","following_url":"https://api.github.com/users/IsantePlus/following{/other_user}","gists_url":"https://api.github.com/users/IsantePlus/gists{/gist_id}","starred_url":"https://api.github.com/users/IsantePlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IsantePlus/subscriptions","organizations_url":"https://api.github.com/users/IsantePlus/orgs","repos_url":"https://api.github.com/users/IsantePlus/repos","events_url":"https://api.github.com/users/IsantePlus/events{/privacy}","received_events_url":"https://api.github.com/users/IsantePlus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics","description":"M2sys biometric server implementation.","fork":false,"url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics","forks_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/forks","keys_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/teams","hooks_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/hooks","issue_events_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues/events{/number}","events_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/events","assignees_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/assignees{/user}","branches_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/branches{/branch}","tags_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/tags","blobs_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/statuses/{sha}","languages_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/languages","stargazers_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/stargazers","contributors_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/contributors","subscribers_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/subscribers","subscription_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/subscription","commits_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/contents/{+path}","compare_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/merges","archive_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/downloads","issues_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues{/number}","pulls_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls{/number}","milestones_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/milestones{/number}","notifications_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/labels{/name}","releases_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/releases{/id}","deployments_url":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/deployments","created_at":"2017-07-28T15:46:43Z","updated_at":"2018-03-14T15:42:52Z","pushed_at":"2018-03-16T12:26:19Z","git_url":"git://github.com/IsantePlus/openmrs-module-m2sys-biometrics.git","ssh_url":"git@github.com:IsantePlus/openmrs-module-m2sys-biometrics.git","clone_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics.git","svn_url":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics","homepage":null,"size":424,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/11"},"html":{"href":"https://github.com/IsantePlus/openmrs-module-m2sys-biometrics/pull/11"},"issue":{"href":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues/11"},"comments":{"href":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/IsantePlus/openmrs-module-m2sys-biometrics/statuses/dc91d572992d628189854d1baf2ee5d6deedd56a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pgesek"}}