Advertisement
Guest User

Untitled

a guest
Jul 30th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 6.93 KB | None | 0 0
  1. (zotonic001@cvm)16> 08:57:19.983 [warning] [cvm] warning @ z_pivot_rsc:355  Pivot error 318: {'EXIT',
  2.                      {function_clause,
  3.                          [{z_memo,is_enabled,
  4.                               [{context,cvm,undefined,undefined,undefined,
  5.                                    undefined,undefined,undefined,undefined,
  6.                                    'z_depcache$cvm','z_notifier$cvm',
  7.                                    'z_session_manager$cvm','z_dispatcher$cvm',
  8.                                    'z_template$cvm','z_scomp$cvm',
  9.                                    'z_dropbox$cvm','z_pivot_rsc$cvm',
  10.                                    'z_module_indexer$cvm',188509,<0.264.0>,
  11.                                    {'z_db_pool$cvm',z_db_pgsql},
  12.                                    en,<<"UTC">>,undefined,undefined,[],[],[],
  13.                                    [],[],[],[],[]}],
  14.                               [{file,"src/support/z_memo.erl"},{line,57}]},
  15.                           {z_acl,rsc_visible,2,
  16.                               [{file,"src/support/z_acl.erl"},{line,98}]},
  17.                           {m_rsc,p,3,
  18.                               [{file,"src/models/m_rsc.erl"},{line,442}]},
  19.                           {mod_endo,do_custom_pivot,2,
  20.                               [{file,
  21.                                    "/home/cvm/production/sites/cvm/modules/mod_endo/mod_endo.erl"},
  22.                                {line,277}]},
  23.                           {lists,map,2,[{file,"lists.erl"},{line,1224}]},
  24.                           {z_pivot_rsc,pivot_resource,2,
  25.                               [{file,"src/support/z_pivot_rsc.erl"},
  26.                                {line,483}]},
  27.                           {z_pivot_rsc,'-do_poll/1-lc$^0/1-0-',2,
  28.                               [{file,"src/support/z_pivot_rsc.erl"},
  29.                                {line,334}]},
  30.                           {z_db,'-transaction1/2-fun-0-',3,
  31.                               [{file,"src/db/z_db.erl"},{line,138}]}]}}
  32.  
  33. init(Context) ->
  34.  
  35.     z_pivot_rsc:define_custom_pivot(endo_stills, [
  36.                                                       {study_rsc, "integer"},
  37.                                                       {study_id, "varchar"},
  38.                                                       {patient_rsc, "integer"},
  39.                                                       {raw_path, "varchar"}
  40.                                                      ], Context),
  41.  
  42.     z_pivot_rsc:define_custom_pivot(endo_videos, [
  43.                                                       {study_rsc, "integer"},
  44.                                                       {study_id, "varchar"},
  45.                                                       {patient_rsc, "integer"},
  46.                                                       {raw_path, "varchar"}
  47.                                                      ], Context),
  48.     z_pivot_rsc:define_custom_pivot(endo_study, [
  49.                                               {date_of_treatment, "timestamp with time zone"},
  50.                                               {study_id, "varchar"},
  51.                                               {accession_num, "varchar"},
  52.                                               {patient_id, "varchar"},
  53.                                               {patient_last, "varchar"},
  54.                                               {patient_first, "varchar"},
  55.                                               {patient_rsc, "integer"},
  56.                                               {surgeon, "varchar"},
  57.                                               {description, "varchar"}
  58.                                              ], Context),
  59.  
  60.     z_pivot_rsc:define_custom_pivot(endo_patient, [
  61.                                               {patient_last, "varchar"},
  62.                                               {patient_first, "varchar"},
  63.                                               {patient_id, "varchar"},
  64.                                               {patient_dob, "timestamp with time zone"},
  65.                                               {gender, "varchar"}
  66.                                              ], Context),
  67.  
  68.     z_notifier:observe(custom_pivot, {?MODULE, do_custom_pivot}, Context).
  69.  
  70.  
  71. do_custom_pivot({custom_pivot, Id}, Context) ->
  72.     case m_rsc:is_a(Id, Context) of
  73.         [study] ->
  74.             StudyDate = m_rsc:p(Id, date_of_treatment, Context),
  75.             StudyId = m_rsc:p(Id, study_id, Context),
  76.             Accession = m_rsc:p(Id, accession_num, Context),
  77.             PtMrn = m_rsc:p(Id, patient_id, Context),
  78.             PtLast = m_rsc:p(Id, patient_last, Context),
  79.             PtFirst = m_rsc:p(Id, patient_first, Context),
  80.             PtRsc = m_rsc:p(Id, patient_rsc, Context),
  81.             Surgeon = m_rsc:p(Id, surgeon, Context),
  82.             Description = m_rsc:p(Id, description, Context),
  83.             {endo_study, [
  84.                        {date_of_treatment, StudyDate},
  85.                        {study_id, StudyId},
  86.                        {accession_num, Accession},
  87.                        {patient_last, PtLast},
  88.                        {patient_first, PtFirst},
  89.                        {patient_id, PtMrn},
  90.                        {patient_rsc, PtRsc},
  91.                        {surgeon, Surgeon},
  92.                        {description, Description}
  93.                       ]
  94.             };
  95.         [patient] ->
  96. LINE 277:   PtLast = m_rsc:p(Id, patient_last, Context),
  97.             PtFirst = m_rsc:p(Id, patient_first, Context),
  98.             PtMrn = m_rsc:p(Id, patient_id, Context),
  99.             PatientDob = m_rsc:p(Id, patient_dob, Context),
  100.             Gender = m_rsc:p(Id, gender, Context),
  101.             {endo_patient, [
  102.                        {patient_last, PtLast},
  103.                        {patient_first, PtFirst},
  104.                        {patient_id, PtMrn},
  105.                        {patient_dob, PatientDob},
  106.                        {gender, Gender}
  107.                       ]
  108.             };
  109.         [stills] ->
  110.             StudyRsc = m_rsc:p(Id, study_rsc, Context),
  111.             StudyId = m_rsc:p(Id, study_id, Context),
  112.             RawPath = m_rsc:p(Id, raw_path, Context),
  113.             PatientRsc = m_rsc:p(Id, patient_rsc, Context),
  114.  
  115.             {endo_stills, [
  116.                        {study_rsc, StudyRsc},
  117.                        {study_id, StudyId},
  118.                        {patient_rsc, PatientRsc},
  119.                        {raw_path, RawPath}
  120.                       ]
  121.             };
  122.         [videos] ->
  123.             StudyRsc = m_rsc:p(Id, study_rsc, Context),
  124.             StudyId = m_rsc:p(Id, study_id, Context),
  125.             RawPath = m_rsc:p(Id, raw_path, Context),
  126.             PatientRsc = m_rsc:p(Id, patient_rsc, Context),
  127.             {endo_videos, [
  128.                        {study_rsc, StudyRsc},
  129.                        {study_id, StudyId},
  130.                        {patient_rsc, PatientRsc},
  131.                        {raw_path, RawPath}
  132.                       ]
  133.             };
  134.         _ ->
  135.             none
  136.     end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement