Hi James,

Oops, probably a typo on my part. That would be:
org.openmrs.OpenmrsConstants.PERSON_TYPE.PERSON

(actually I changed this to PERSON because technically any observation
should be considered, even if it's somehow on a non-patient person)

-Darius

On Mon, Sep 19, 2011 at 2:15 PM, James Arbaugh <[email protected]>wrote:

> Darius,****
>
> ** **
>
> I’m embarrassed to keep asking for help on this, but I feel we’ve gone so
> far we must nearly have it figured out; to abandon now would waste all the
> effort we’ve already put into it.****
>
> ** **
>
> I think there is a problem with the PERSON_TYPE.PATIENT line.  When I run…
> ****
>
> def concept =
> org.openmrs.api.context.Context.getConceptService().getConcept(6407);****
>
>     java.util.Collections.singletonList(concept)****
>
> return new Result(0)****
>
> …the results are as expected, with no error.****
>
> ** **
>
> When I try the similar logic of…****
>
> def concept =
> org.openmrs.api.context.Context.getConceptService().getConcept(6407);****
>
>
> java.util.Collections.singletonList(org.openmrs.util.PERSON_TYPE.PATIENT)*
> ***
>
> return new Result(0)****
>
> …it gives the following error…****
>
> Hl7inQueue.queueList.errorMessage.header:
> groovy.lang.MissingPropertyException: No such property: org for class:
> org.openmrs.module.logic.rule.GroovyRule1 Show/Hide Error Details****
>
> ** **
>
> ------ groovy.lang.MissingPropertyException: No such property: org for
> class: org.openmrs.module.logic.rule.GroovyRule1 at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49)
> at
> org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:71)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:241)
> at
> org.openmrs.module.logic.rule.GroovyRule1.eval(script1316466520984239894648.groovy:11)
> at org.openmrs.logic.impl.LogicContextImpl.eval(LogicContextImpl.java:194)
> at org.openmrs.logic.impl.LogicServiceImpl.eval(LogicServiceImpl.java:212)
> at org.openmrs.logic.impl.LogicServiceImpl.eval(LogicServiceImpl.java:202)
> at org.openmrs.logic.impl.LogicServiceImpl.eval(LogicServiceImpl.java:235)
> at sun.reflect.GeneratedMethodAccessor1176.invoke(Unknown Source) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597) at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
> at $Proxy143.eval(Unknown Source) at
> sun.reflect.GeneratedMethodAccessor1176.invoke(Unknown Source) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597) at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at org.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:114) at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
> at $Proxy144.eval(Unknown Source) at
> sun.reflect.GeneratedMethodAccessor1176.invoke(Unknown Source) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597) at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
> at $Proxy144.eval(Unknown Source) at
> org.openmrs.logic.web.controller.LogicFormController.runTest(LogicFormController.java:82)
> at sun.reflect.GeneratedMethodAccessor1340.invoke(Unknown Source) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597) at
> org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
> at
> org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
> at
> org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
> at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
> at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
> at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
> at
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
> at org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
> at
> org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
> at
> org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)
> at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)
> at java.lang.Thread.run(Thread.java:619) ------****
>
> ** **
>
> I tried using null in place of
> “java.util.Collections.singletonList(org.openmrs.util.PERSON_TYPE.PATIENT)”
> when passing it into getObservations() but that didn’t work either.****
>
> ** **
>
> Is there any hope?****
>
> ** **
>
> Thanks,****
>
> James****
>
> ** **
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Darius Jazayeri
> *Sent:* Monday, September 19, 2011 11:48 AM
>
> *To:* [email protected]
> *Subject:* Re: [OPENMRS-IMPLEMENTERS] Auto-Incrementing Numeric
> Observation****
>
> ** **
>
> James,
> What you're actually trying to do is to call this method:
>
> List<Obs> getObservations(List<Person> whom, List<Encounter> encounters,
> List<Concept> questions, List<Concept> answers, List<PERSON_TYPE>
> personTypes, List<Location> locations, List<String> sort, Integer
> mostRecentN, Integer obsGroupId, Date fromDate, Date toDate, boolean
> includeVoidedObs)****
>
> ** **
>
> So the call should be:****
>
> def concept = org.openmrs.api.Context.getConceptService().getConcept(6047);
> ****
>
> def obs = getObservations(****
>
>     null, // all patients****
>
>     null, // all encounters****
>
>     java.util.Collections.singletonList(concept), // just this one concept
> as question****
>
>     null, // don't specify any coded answers****
>
>
> java.util.Collections.singletonList(org.openmrs.util.PERSON_TYPE.PATIENT),
> // only obs belonging to patients****
>
>     null, // all locations****
>
>     java.util.Collections.singletonList("valueNumeric desc"), // sort order
> ****
>
>     1, // just one****
>
>     null, // don't specify any obs group****
>
>     null, // don't specify date range****
>
>     null, // don't specify date range****
>
>     false)****
>
> return new Result(obs[0])****
>
> ** **
>
> -Darius****
>
> ** **
>
> On Mon, Sep 19, 2011 at 8:14 AM, James Arbaugh <[email protected]>
> wrote:****
>
> Darius,****
>
>  ****
>
> You’re correct, it required org.openmrs.api.ObsService.****
>
>  ****
>
> Now, when I try the following groovy code…****
>
> return new
> Result(org.openmrs.api.ObsService.getObservations(6407,"mostRecentN=1
> sort="valueNumeric desc""))****
>
>  ****
>
> I get…****
>
> Hl7inQueue.queueList.errorMessage.header: Invalid Logic Rule. ****
>
> Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException:
> startup failed:****
>
> script13164429085571793441641.groovy: 10: expecting ')', found
> 'valueNumeric' @ line 10, column 88.****
>
>    ons(6407,"mostRecentN=1 sort="valueNumer****
>
>  ****
>
> When I try the following groovy code…****
>
> return new
> Result(org.openmrs.api.ObsService.getObservations(6407,"mostRecentN=1
> sort="desc""))****
>
>  ****
>
> I get…****
>
> Hl7inQueue.queueList.errorMessage.header: Invalid Logic Rule. ****
>
> Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException:
> startup failed:****
>
> script13164431339642031039791.groovy: 10: expecting ')', found 'desc' @
> line 10, column 88.****
>
>    ons(6407,"mostRecentN=1 sort="desc""))****
>
>  ****
>
> When I try the following groovy code…****
>
> return new
> Result(org.openmrs.api.ObsService.getObservations(6407,"mostRecentN=1 and
> sort="valueNumeric desc""))****
>
>  ****
>
> I get…****
>
> Hl7inQueue.queueList.errorMessage.header: Invalid Logic Rule. ****
>
> Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException:
> startup failed:****
>
> script13164431339642031039791.groovy: 10: expecting ')', found 'desc' @
> line 10, column 88.****
>
>    ons(6407,"mostRecentN=1 sort="desc""))****
>
>  ****
>
> WhenI try the following groovy code…****
>
> return new
> Result(org.openmrs.api.ObsService.getObservations(6407,"mostRecentN=1 and
> sort=valueNumeric desc"))****
>
>  ****
>
> I get…****
>
> Hl7inQueue.queueList.errorMessage.header:
> groovy.lang.MissingMethodException: No signature of method: static
> org.openmrs.api.ObsService.getObservations() is applicable for argument
> types: (java.lang.Integer, java.lang.String) values: [6407, mostRecentN=1
> and sort=valueNumeric desc]****
>
>  ****
>
> What am I doing wrong with the getObservations()? Any idea why the SQL
> Groovy code doesn’t work?****
>
>  ****
>
> Roger and Darius,****
>
> Thanks for your concerns on blood banking standards.  I took up your
> suggestions with our medical director concerning the abnormal usage of a
> serial number for blood bank baggies.  She said “We shouldn't change the
> coding system, as it is done like this in every blood bank in Haiti.” If we
> used a different serial number system, it would confuse them when we send
> the blood to Port-au-Prince (I initially suggested using the encounter_id).
> The Red Cross is implementing a software system in Haiti, but it doesn't
> have a registry for our donors in it, it is essentially to find out where
> what kind of blood is in stock, so that it can be ordered from this hospital
> if needed. Your concerns on standard practice should to be taken up at a
> higher level.****
>
>  ****
>
> Thanks,****
>
> James****
>
>  ****
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Darius Jazayeri
> *Sent:* Friday, September 16, 2011 11:25 AM****
>
>
> *To:* [email protected]****
>
> *Subject:* Re: [OPENMRS-IMPLEMENTERS] Auto-Incrementing Numeric
> Observation****
>
>  ****
>
> James,****
>
> You need to do org.openmrs.api.ObsService I think.****
>
> -Darius (by phone)****
>
> On Sep 16, 2011 8:20 AM, "Friedman, Roger (CDC/CGH/DGHA) (CTR)" <
> [email protected]> wrote:****
>
> James --****
>
>                 Because of the criticality of blood tracking, it's
> important that there be a check digit on your blood bag ID.  So maybe you
> should use the algorithm from ID generation rather than just a sequence
> number.  ****
>
>                 Also I don't know if you are tracking the blood after it's
> processed into different products and then into the patient, but that's the
> standard of care for blood.  Certainly it would be good at least to check
> the blood against your testing records before use, that's where
> discrepancies would appear.  You'd be better off printing barcodes and avoid
> rewriting.  There are also standards for that.****
>
>                 I know that we here at CDC are doing blood bank system
> strengthening in Haiti and that hospital-based collection and processing is
> not the international norm, especially when presence of transmissible
> disease is high.  Rather, collection efforts are based around community
> drives, particularly where young as-yet-uninfected people can be found, with
> processing at high-volume centers which warehouse the products and
> distribute them to hospitals, with only a few days supply stored at the
> hospital.  ****
>
>                 In short, there are lots of international standards around
> bloodbanking that are important and which I can send if you're interested.
> There are also commercial solutions which might do the job cheaper, faster
> and with better compliance with international standards than you can. ****
>
> Saludos, Roger****
>
>  ****
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *James Arbaugh
> *Sent:* Thursday, September 15, 2011 11:20 PM****
>
>
> To: [email protected]
> Subject: Re: [OPENMRS-IMPLEMENTERS] Auto-Incrementing Nu...****
>
>
>
>
>
> Thanks Darius (and Daniel)!
>
>
>
> I’m trying to write my Groovy rule, and it’s not working like I...****
>
>
>
> ________________________________
> Click here to unsubscribe from OpenMRS Implementers' mailing list****
>
> ------------------------------
>
> Click here to 
> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-implement-l>from
>  OpenMRS Implementers' mailing list
> ****
> ------------------------------
>
> Click here to 
> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-implement-l>from
>  OpenMRS Implementers' mailing list
> ****
>
> ** **
> ------------------------------
>
> Click here to 
> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-implement-l>from
>  OpenMRS Implementers' mailing list
> ****
>  ------------------------------
> Click here to 
> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-implement-l>from
>  OpenMRS Implementers' mailing list
>

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-implement-l" in the  body 
(not the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l]

Reply via email to