WaihonaPedia supportside

ExportResearchPrintMacro


== Print vragen == "code"
includedScorecards
includeMedication
includeTreatments
researcher
start
endData
finish
forSpecificDeceases
sharetypes
printSkin
printSheet
printLabelKey
printTableOfContents
aboutQuestionairre
cdls.dashboard.exportCSV.research.creationDate cdls.dashboard.exportCSV.research.updateDate cdls.dashboard.exportCSV.research.revision cdls.dashboard.exportCSV.research.comments
{{velocity}} {{html clean = false}} == Print vragen == #set($researchClassName = 'WaihonaCode.researchClass') #set ($discard = $doc.use($researchClassName)) #set($docRef = $services.model.createDocumentReference('' ,'WaihonaCode','qpiClass')) #set($document = $xwiki.getDocument($docRef)) $document.getContent() #set ($discard = $services.localization.use('document', 'WaihonaCode.researchTranslations')) ##set($ok = $response.setContentType("text/html")) ##set($ok = $response.setHeader("Content-disposition", "attachment; filename=${services.localization.render('exportCSV-fileName')}.html")) #set($researchClass = $xwiki.getDocument($researchClassName)) #set($xclass = $researchClass.getxWikiClass()) #set($props = $xclass.properties) #set($researchObject = $doc.getObject($researchClassName)) #set($researchCommentsObjs = $doc.getObjects('XWiki.XWikiComments')) #set($researchPropsToSkip = ['name', 'includedQuestionnaires', 'code', 'title', 'description']) ## RESEARCH table header (excluding name and includedQuestionnaires properties of research doc) "code" #foreach($prop in $props) #if(!$researchPropsToSkip.contains($prop.name))
${prop.name} #end #end
$!services.localization.render('cdls.dashboard.exportCSV.research.creationDate') $!services.localization.render('cdls.dashboard.exportCSV.research.updateDate') $!services.localization.render('cdls.dashboard.exportCSV.research.revision') $!services.localization.render('cdls.dashboard.exportCSV.research.comments') ## RESEARCH metadata
$!doc.getValue('code') #foreach($prop in $props) #if(!$researchPropsToSkip.contains($prop.name)) $!doc.getValue($prop.name) #end #end $doc.creationDate $doc.date $doc.getRecentRevisions(1)[0] #foreach($commentObj in $researchCommentsObjs) ${commentObj.getValue('comment')}
#end ## ## Get questionaires #set( $vQuestionaires = [] ) #set( $includedQuestionnaires = $researchObject.getProperty('includedQuestionnaires').property.value) #set( $questionnaires = [] ) #set( $extensions = $services.uix.getExtensions('waihonapedia.questions', {'sortByParameter' : 'displayorder'}) ) #foreach($ext in $extensions) #foreach($selected in $includedQuestionnaires) #if($selected.contains($ext.getParameters().label)) #set( $discard = $questionnaires.add($ext.getParameters().label) ) #end #end #end #set($headerMap = {}) ## ## For all questionaires #foreach($questionnaire in $questionnaires) ## ## Get answers given by the current user #set( $classDoc = $xwiki.getDocument("${questionnaire}.WebHome") ) #set( $className = $classDoc.getObject('AppWithinMinutes.LiveTableClass').get('class') ) #set( $vQuery = "from doc.object('$className') as $questionnaire where doc.author = :thisUser and doc.fullName <> 'WaihonaCode.${questionnaire}Template' order by doc.date desc") #set( $vQuestionaires = $services.query.xwql("$vQuery").bindValue("thisUser", "$xcontext.user").execute()) ## Display the introduction that belongs to the questionnaire #set( $introDoc = $xwiki.getDocument("${questionnaire}.introduction") ) ## Following line is fault: In CdLS World questionnaire class would be in the data-space, but not in WaihonaPedia! #set($questClassName = "WaihonaCode.${questionnaire}Class" ) #set($questClassDoc = $xwiki.getDocument($questClassName)) #set($questXClass = $questClassDoc.getxWikiClass()) #set($questProps = $questXClass.properties) ## QUESTIONAIRE header
$!{questionnaire} #foreach($questProp in $questProps) $questProp.name $document.display($questProp.name,"view") #if($foreach.hasNext()) ; #end #end $!services.localization.render('cdls.dashboard.exportCSV.research.creationDate') $!services.localization.render('cdls.dashboard.exportCSV.research.updateDate') $!services.localization.render('cdls.dashboard.exportCSV.research.revision') $!services.localization.render('cdls.dashboard.exportCSV.research.comments') ## QUESTIONAIRE metadata ## Next : questionaire metadata ## Following line is not optimal or even deprecated (searchDocumnets)? Better to use wall query? #set($questAnswerDocList = $xwiki.searchDocuments(', BaseObject as obj where obj.name=doc.fullName and obj.className=? and doc.name not like ? and doc.creator = ?', 0, 0, [$questClassName, '%Template', $xcontext.user])) #foreach($questAnswerDocName in $questAnswerDocList) #set($questAnswerDoc = $xwiki.getDocument($questAnswerDocName)) #set($questAnswerObj = $questAnswerDoc.getObject($questClassName)) #set($questCommentsObjs = $questAnswerDoc.getObjects('XWiki.XWikiComments')) #foreach($questProp in $questProps) $!questAnswerObj.getValue($questProp.name) #if($foreach.hasNext()) - #end #end $questAnswerDoc.creationDate $questAnswerDoc.date $questAnswerDoc.getRecentRevisions(1)[0] #foreach($commentObj in $questCommentsObjs) ${commentObj.getValue('comment')}
#end #end #end ## Now, enable the flag on send data for the current user participation on the current research #set($userDoc = $xwiki.getDocument($xcontext.user)) #set($userObj = $userDoc.getObject('XWiki.XWikiUsers')) #set($userParticipationDoc = $xwiki.getDocument("cdlsRparticipation.${userObj.getValue('first_name')}${userObj.getValue('last_name')}_${researchObject.getValue('code')}")) #set($userParticipationObj = $userParticipationDoc.getObject('WaihonaCode.researchParticipationClass')) #if("$!userParticipationObj.getValue('datasend')" != 1) #set($discard = $userParticipationObj.set('datasend', 1)) $xwiki.getXWiki().saveDocument($userParticipationDoc.getDocument(), $xcontext.context) #end {{/html}} {{/velocity}}
Thu Jan 26 14:02:45 CET 2017 Wed Feb 14 14:27:22 CET 2024 13.1

Om indholdet af hjemmesiden

Alle oplysninger på dette websted er udelukkende til undervisningsformål. Det er din læge, der er det rette sted at få specifik medicinsk rådgivning, diagnoser og behandling. Brug af dette websted sker udelukkende på eget ansvar. Hvis du finder noget, som du mener, der skal rettes eller præciseres, bedes du give os besked på: 

Send en e-mail: info@cdlsWorld.org